Machine Code Generation for C++
A simple implementation of memory manager that uses
asmjit::VirtMem functions to manage virtual memory for JIT compiled code.
kFlagUseMultiplePoolsflag to be set.
JitAllocator instance and release all blocks held.
Free all allocated memory - makes all pointers returned by
reset()when the allocator is still in use.
Returns allocator options, see
Tests whether the allocator has the given
Returns a base block size (a minimum size of block that the allocator would allocate).
Returns granularity of the allocator.
Returns pattern that is used to fill unused memory if
kFlagUseFillPattern is set.
Allocates a new memory block of the requested
When the function is successful it stores two pointers in
rwPtrOut. The pointers will be different only if
kOptionUseDualMapping was used to setup the allocator (in that case the
rxPtrOut would point to a Read+Execute region and
rwPtrOut would point to a Read+Write region of the same memory-mapped block.
Releases a memory block returned by
Frees extra memory allocated with
rxPtr by shrinking it to the given
Queries information about an allocated memory block that contains the given
The function returns
rxPtr is matched and fills
sizeOut output arguments. The returned
rwPtrOut pointers point to the beginning of the block, and
sizeOut describes the total amount of bytes this allocation uses -
sizeOut will always be aligned to the allocation granularity, so for example if an allocation was 1 byte and the size granularity is 64, the returned
sizeOut will be 64 bytes, because that's what the allocator sees.
Returns JIT allocator statistics.
Allocator implementation (private).