Low-Latency Machine Code Generation
A memory reference returned by JitAllocator::alloc().
Span contains everything needed to actually write new code to the memory chunk it references.
Returns a pointer having Read & Execute permissions (references executable memory).
This pointer is never NULL if the allocation succeeded, it points to an executable memory.
Returns a pointer having Read & Write permissions (references writable memory).
Depending on the type of the allocation strategy this could either be:
rx()if the allocator uses RWX mapping (pages have all of Read, Write, and Execute permissions) or MAP_JIT, which requires either ProtectJitReadWriteScope or to call VirtMem::protectJitMemory() manually.
rx- this would be valid if dual mapping is used.
rw()returns a non-null pointer it's important to use either VirtMem::protectJitMemory() or ProtectJitReadWriteScope to guard the write, because in case of
MAP_JITit would temporarily switch the permissions of the pointer to RW (that's per thread permissions). if ProtectJitReadWriteScope is not used it's important to clear the instruction cache via VirtMem::flushInstructionCache() after the write is done.
Returns size of this span, aligned to the allocator granularity.
Returns span flags.
Shrinks this span to
Returns whether rw() returns a non-null pointer.
Address of memory that has Read and Execute permissions.
Address of memory that has Read and Write permissions.
Size of the span in bytes (rounded up to the allocation granularity).
Pointer that references a memory block maintained by JitAllocator.
This pointer is considered private and should never be used nor inspected outside of AsmJit.
Reserved for future use.