mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-29 12:23:54 +01:00
Avoid unnecessary memset when allocating array literals.
This completes the merge of pull request #294. Thanks a lot to Chris Holdsworth who originally wrote the patch! GitHub: Fixes #294. GitHub: Fixes #141.
This commit is contained in:
+3
-1
@@ -583,7 +583,9 @@ DSliceValue* DtoNewDynArray(Loc& loc, Type* arrayType, DValue* dim, bool default
|
||||
defaultInit = false;
|
||||
bool zeroInit = eltType->isZeroInit();
|
||||
|
||||
const char* fnname = zeroInit ? "_d_newarrayT" : "_d_newarrayiT";
|
||||
const char* fnname = defaultInit ?
|
||||
(zeroInit ? "_d_newarrayT" : "_d_newarrayiT") :
|
||||
"_d_newarrayvT";
|
||||
LLFunction* fn = LLVM_D_GetRuntimeFunction(gIR->module, fnname);
|
||||
|
||||
// call allocator
|
||||
|
||||
Reference in New Issue
Block a user