asmjit::VirtMem::ProtectJitReadWriteScope Class Reference

JIT protection scope that prepares the given memory block to be written to in the current thread.

It calls VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadWrite) at construction time and VirtMem::protectJitMemory(VirtMem::ProtectJitAccess::kReadExecute) combined with flushInstructionCache() in destructor. The purpose of this class is to make writing to JIT memory easier.

Public Members


Member Functions

Construction & Destruction

Constructor & Destructor Documentation

VirtMem::ProtectJitReadWriteScope::ProtectJitReadWriteScope(void* rxPtr, size_t size, CachePolicy policy = CachePolicy::kDefault)noexcept◆ 

Makes the given memory block RW protected.


Makes the memory block RX protected again and flushes instruction cache.