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
Modifier and TypeMethodDescriptionlong
allocate
(long memoryLength) Allocates a new chunk of memory sized to the given length.void
deallocate
(long memoryAddress, long size) Deallocates the memory at the given address assuming a given size.long
-
Method Details
-
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, 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()
-