mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
bytecode_ptr: add make_zeroed_bytecode_ptr
Rather than always zeroing memory.
This commit is contained in:
committed by
Matthew Barr
parent
5653fa55a1
commit
63fe84c3f1
@@ -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);
|
||||
|
@@ -74,7 +74,7 @@ bytecode_ptr<noodTable> noodBuildTable(const hwlmLiteral &lit) {
|
||||
|
||||
const auto &s = lit.s;
|
||||
size_t noodle_len = sizeof(noodTable) + s.length();
|
||||
auto n = make_bytecode_ptr<noodTable>(noodle_len);
|
||||
auto n = make_zeroed_bytecode_ptr<noodTable>(noodle_len);
|
||||
assert(n);
|
||||
|
||||
size_t key_offset = findNoodFragOffset(lit);
|
||||
|
Reference in New Issue
Block a user