bytecode_ptr: add make_zeroed_bytecode_ptr

Rather than always zeroing memory.
This commit is contained in:
Justin Viiret
2017-04-04 11:02:33 +10:00
committed by Matthew Barr
parent 5653fa55a1
commit 63fe84c3f1
19 changed files with 40 additions and 24 deletions

View File

@@ -165,7 +165,8 @@ bytecode_ptr<HWLM> hwlmBuild(const vector<hwlmLiteral> &lits, bool make_small,
throw ResourceLimitError();
}
auto h = make_bytecode_ptr<HWLM>(ROUNDUP_CL(sizeof(HWLM)) + engSize, 64);
const size_t hwlm_len = ROUNDUP_CL(sizeof(HWLM)) + engSize;
auto h = make_zeroed_bytecode_ptr<HWLM>(hwlm_len, 64);
h->type = engType;
memcpy(HWLM_DATA(h.get()), eng.get(), engSize);