Package org.infinispan.container.offheap
Interface OffHeapMemoryAllocator
-
- All Known Implementing Classes:
UnpooledOffHeapMemoryAllocator
public interface OffHeapMemoryAllocator
Allows for allocation of memory outside of the heap as well additional functionality surrounding it if necessary.- Since:
- 9.0
- Author:
- wburns
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
allocate(long memoryLength)
Allocates a new chunk of memory sized to the given length.void
deallocate(long memoryAddress)
Deallocates the memory allocated at the given addressvoid
deallocate(long memoryAddress, long size)
Deallocates the memory at the given address assuming a given size.long
getAllocatedAmount()
-
-
-
Method Detail
-
allocate
long allocate(long memoryLength)
Allocates a new chunk of memory sized to the given length.- Parameters:
memoryLength
- the size of memory to allocate- Returns:
- the memory address where the memory resides
-
deallocate
void deallocate(long memoryAddress)
Deallocates the memory allocated at the given address- Parameters:
memoryAddress
- the address returned from the allocator to deallocate
-
deallocate
void deallocate(long memoryAddress, long size)
Deallocates the memory at the given address assuming a given size. This size is the size that was provided to allocate.- Parameters:
memoryAddress
- the address to deallocate fromsize
- the total size
-
getAllocatedAmount
long getAllocatedAmount()
-
-