diff options
Diffstat (limited to 'src/JitInterface/src/ThunkGenerator/corjithost.h')
-rw-r--r-- | src/JitInterface/src/ThunkGenerator/corjithost.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/JitInterface/src/ThunkGenerator/corjithost.h b/src/JitInterface/src/ThunkGenerator/corjithost.h index 8242fab2b..b2ab80646 100644 --- a/src/JitInterface/src/ThunkGenerator/corjithost.h +++ b/src/JitInterface/src/ThunkGenerator/corjithost.h @@ -15,15 +15,11 @@ class ICorJitHost { public: - // Allocate memory of the given size in bytes. All bytes of the returned block - // must be initialized to zero. If `usePageAllocator` is true, the implementation - // should use an allocator that deals in OS pages if one exists. - virtual void* allocateMemory(size_t size, bool usePageAllocator = false) = 0; + // Allocate memory of the given size in bytes. + virtual void* allocateMemory(size_t size) = 0; - // Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`. The - // value of the `usePageAllocator` parameter must match the value that was - // provided to the call to used to allocate the memory. - virtual void freeMemory(void* block, bool usePageAllocator = false) = 0; + // Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`. + virtual void freeMemory(void* block) = 0; // Return an integer config value for the given key, if any exists. virtual int getIntConfigValue( @@ -43,6 +39,20 @@ public: virtual void freeStringConfigValue( const wchar_t* value ) = 0; + + // Allocate memory slab of the given size in bytes. The host is expected to pool + // these for a good performance. + virtual void* allocateSlab(size_t size, size_t* pActualSize) + { + *pActualSize = size; + return allocateMemory(size); + } + + // Free memory slab of the given size in bytes. + virtual void freeSlab(void* slab, size_t actualSize) + { + freeMemory(slab); + } }; #endif |