mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-12-31 21:59:07 +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
@@ -207,7 +207,7 @@ bytecode_ptr<u8> setupFDRFloodControl(const vector<hwlmLiteral> &lits,
|
||||
size_t floodStructSize = sizeof(FDRFlood) * nDistinctFloods;
|
||||
size_t totalSize = ROUNDUP_16(floodHeaderSize + floodStructSize);
|
||||
|
||||
auto buf = make_bytecode_ptr<u8>(totalSize, 16);
|
||||
auto buf = make_zeroed_bytecode_ptr<u8>(totalSize, 16);
|
||||
assert(buf); // otherwise would have thrown std::bad_alloc
|
||||
|
||||
u32 *floodHeader = (u32 *)buf.get();
|
||||
|
||||
Reference in New Issue
Block a user