asmjit::JitAllocator::CreateParams Struct Reference

Parameters that can be passed to JitAllocator constructor.

Use it like this:

// Zero initialize (zero means the default value) and change what you need.
JitAllocator::CreateParams params {};
params.blockSize = 1024 * 1024;
// Create the allocator.
JitAllocator allocator(&params);

Public Members

Member Functions

Member Data Documentation

uint32_t JitAllocator::CreateParams::options

Allocator options, see JitAllocator::Options.

No options are used by default.

uint32_t JitAllocator::CreateParams::blockSize

Base size of a single block in bytes (default 64kB).

Remarks
Block size must be equal or greater to page size and must be power of 2. If the input is not valid then the default block size will be used instead.

uint32_t JitAllocator::CreateParams::granularity

Base granularity (and also natural alignment) of allocations in bytes (default 64).

Since the JitAllocator uses bit-arrays to mark used memory the granularity also specifies how many bytes correspond to a single bit in such bit-array. Higher granularity means more waste of virtual memory (as it increases the natural alignment), but smaller bit-arrays as less bits would be required per a single block.

uint32_t JitAllocator::CreateParams::fillPattern

Patter to use to fill unused memory.

Only used if kOptionCustomFillPattern is set.