public final class DefaultMemoryRequestServer extends Object implements MemoryRequestServer
Constructor and Description |
---|
DefaultMemoryRequestServer()
Default constructor.
|
DefaultMemoryRequestServer(boolean offHeap,
boolean copyOldToNew)
Constructor with parameters
|
Modifier and Type | Method and Description |
---|---|
WritableMemory |
request(WritableMemory currentWmem,
long newCapacityBytes)
Request new WritableMemory with the given newCapacityBytes.
|
void |
requestClose(WritableMemory memToClose,
WritableMemory newMemory)
Request to close the resource, if applicable.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
requestClose
public DefaultMemoryRequestServer()
public DefaultMemoryRequestServer(boolean offHeap, boolean copyOldToNew)
offHeap
- if true, the returned new memory will be off heapcopyOldToNew
- if true, the data from the current memory will be copied to the new memory,
starting at address 0, and through the currentMemory capacity.public WritableMemory request(WritableMemory currentWmem, long newCapacityBytes)
MemoryRequestServer
request
in interface MemoryRequestServer
currentWmem
- the current writableMemory of the client. It must be non-null.newCapacityBytes
- The capacity being requested. It must be > the capacity of the currentWritableMemory.public void requestClose(WritableMemory memToClose, WritableMemory newMemory)
MemoryRequestServer
requestClose
in interface MemoryRequestServer
memToClose
- the relevant WritbleMemory to be considered for closing. It must be non-null.newMemory
- the newly allocated WritableMemory.
The newMemory reference is returned from the client for the convenience of the system that
owns the responsibility of memory allocation. It may be null.Copyright © 2015–2024. All rights reserved.