public class DefaultMemoryAllocator extends java.lang.Object implements MemoryAllocator
| Constructor and Description |
|---|
DefaultMemoryAllocator() |
| Modifier and Type | Method and Description |
|---|---|
Memory |
allocate(long size)
Allocate a memory of the specified byte length.
|
long |
allocatedSize()
Get the total amount of allocated memory
|
void |
register(Memory m)
Register a memory
|
void |
release(Memory m)
Release a memory
|
void |
release(MemoryReference ref)
Release a memory, referenced by ref
|
void |
releaseAll()
Release all memory addresses taken by this allocator.
|
public long allocatedSize()
allocatedSize in interface MemoryAllocatorpublic Memory allocate(long size)
allocate in interface MemoryAllocatorsize - byte length of the memorypublic void register(Memory m)
MemoryAllocatorregister in interface MemoryAllocatorpublic void releaseAll()
public void release(MemoryReference ref)
MemoryAllocatorrelease in interface MemoryAllocatorpublic void release(Memory m)
MemoryAllocatorrelease in interface MemoryAllocator