public interface MemoryPool extends Disposable, AutoCloseable
A pool of memory from which allocations can occur.
| Modifier and Type | Interface and Description |
|---|---|
static class |
MemoryPool.Type |
| Modifier and Type | Method and Description |
|---|---|
long |
calloc(long theSize)
Allocate memory from this pool and zero it
|
boolean |
canAllocate(long theSize)
Returns whether or not the pool can perform an allocation of the given size.
|
void |
close() |
default void |
dispose()
Clean up this memory pool.
|
boolean |
free(long theAddress)
Return the memory at the given address to the pool
|
default String |
getName()
Returns the name of the memory pool
|
MemoryPool.Type |
getType()
Return the type of memory in the pool
|
default boolean |
isEmpty()
Return whether or not there is any memory left in this pool.
|
long |
malloc(long theSize)
Allocate memory from this pool.
|
long |
memLeft()
Return how many bytes remain in this pool
|
long |
size()
Return the total size of the memory pool
|
MemoryPool |
slice(long theSize)
Create a child pool of the given size.
|
default String getName()
MemoryPool.Type getType()
void close()
close in interface AutoCloseabledefault void dispose()
child pools.dispose in interface Disposablelong malloc(long theSize)
theSize - the amount of memory to allocateNotEnoughMemoryException - if the pool does not have enough memory to complete the allocationlong calloc(long theSize)
theSize - the amount of memory to allocateNotEnoughMemoryException - if the pool does not have enough memory to complete the allocationboolean free(long theAddress)
theAddress - the addressboolean canAllocate(long theSize)
theSize - the size of the allocationdefault boolean isEmpty()
memLeft() == 0long memLeft()
long size()
MemoryPool slice(long theSize)
theSize - the size of the child poolCopyright © 2010-2016 Stardog Union. All Rights Reserved.