AsmJit
Low-Latency Machine Code Generation
JIT execution runtime is a special Target
that is designed to store and execute a generated code.
JIT runtime is the easiest way of using AsmJit as it abstracts allocation and deallocation of virtual memory where executable code can be placed and from which it can be executed as well.
nullptr
)explicitnoexcept◆ Creates a JitRuntime
instance.
Destroys the JitRuntime
instance.
ResetPolicy::kSoft
)noexcept◆ Resets the JitRuntime, freeing everything that was allocated by it.
Depending on resetPolicy
the currently held memory can be either freed entirely when ResetPolicy::kHard is used, or the allocator can keep some of it for next allocations when ResetPolicy::kSoft is used, which is the default behavior.
Returns the associated JitAllocator
.
Allocates memory needed for a code stored in the CodeHolder
and relocates the code to the pointer allocated.
The beginning of the memory allocated for the function is returned in dst
. If failed Error
code is returned and dst
is explicitly set to nullptr
(this means that you don't have to set it to null before calling add()
).
Releases p
which was obtained by calling add()
.
Type-unsafe version of add()
.
Type-unsafe version of release()
.
Virtual memory allocator.