public interface MemoryRequest
| Modifier and Type | Method and Description |
|---|---|
void |
free(Memory mem)
The given Memory with its capacity is to be freed.
|
void |
free(Memory memToFree,
Memory newMem)
The given memToFree with its capacity may be freed by the implementation.
|
Memory |
request(long capacityBytes)
Request new Memory with the given capacity.
|
Memory |
request(Memory origMem,
long copyToBytes,
long capacityBytes)
Request for allocate and copy.
|
Memory request(long capacityBytes)
capacityBytes - The capacity being requestedMemory request(Memory origMem, long copyToBytes, long capacityBytes)
Request to allocate new Memory with the capacityBytes; copy the contents of origMem from zero to copyToBytes.
origMem - The original Memory, a portion, starting at zero, which will be copied to the
newly allocated Memory. This reference must not be null.
This origMem must not modified in any way, and may be reused or freed by the implementation.
The requesting application may NOT assume anything about the origMem.copyToBytes - the upper limit of the region to be copied from origMem to the newly
allocated memory. The upper region of the new Memory may or may not be cleared depending
on the implementation.capacityBytes - the desired new capacity of the newly allocated memory in bytes.void free(Memory mem)
mem - The Memory to be freedvoid free(Memory memToFree, Memory newMem)
memToFree - the Memory to be freed. It is assumed that the implementation of
this interface knows the type of Memory that was created and how to free it, if desired.newMem - Providing a reference to newMem enables the implementation to link the memToFree to the
newMem, if desired.Copyright © 2015–2017 Yahoo! Inc.. All rights reserved.