mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 01:12:15 +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
@@ -1797,7 +1797,7 @@ struct Factory {
|
||||
|
||||
u32 tableOffset, tugMaskOffset;
|
||||
size_t len = repeatAllocSize(br, &tableOffset, &tugMaskOffset);
|
||||
auto info = make_bytecode_ptr<NFARepeatInfo>(len);
|
||||
auto info = make_zeroed_bytecode_ptr<NFARepeatInfo>(len);
|
||||
char *info_ptr = (char *)info.get();
|
||||
|
||||
// Collect state space info.
|
||||
@@ -2297,7 +2297,7 @@ struct Factory {
|
||||
|
||||
size_t nfaSize = sizeof(NFA) + offset;
|
||||
DEBUG_PRINTF("nfa size %zu\n", nfaSize);
|
||||
auto nfa = make_bytecode_ptr<NFA>(nfaSize);
|
||||
auto nfa = make_zeroed_bytecode_ptr<NFA>(nfaSize);
|
||||
assert(nfa); // otherwise we would have thrown std::bad_alloc
|
||||
|
||||
implNFA_t *limex = (implNFA_t *)getMutableImplNfa(nfa.get());
|
||||
|
||||
Reference in New Issue
Block a user