public class PortableThreadLocalMemoryAllocator extends Object implements PortableMemoryAllocator
| Modifier and Type | Field and Description |
|---|---|
protected static long |
BYTE_ARR_OFF
Array offset: byte.
|
static PortableThreadLocalMemoryAllocator |
THREAD_LOCAL_ALLOC
Memory allocator instance.
|
protected static sun.misc.Unsafe |
UNSAFE
Unsafe instance.
|
DFLT_ALLOC| Modifier and Type | Method and Description |
|---|---|
byte[] |
allocate(int size)
Allocate memory.
|
long |
allocateDirect(int size)
Allocate memory.
|
boolean |
isThreadLocalArrayAcquired()
Checks whether a thread-local array is acquired or not.
|
byte[] |
reallocate(byte[] data,
int size)
Reallocates memory.
|
long |
reallocateDirect(long addr,
int size)
Reallocate memory.
|
void |
release(byte[] data,
int maxMsgSize)
Release memory.
|
void |
releaseDirect(long addr)
Release memory.
|
public static final PortableThreadLocalMemoryAllocator THREAD_LOCAL_ALLOC
protected static final sun.misc.Unsafe UNSAFE
protected static final long BYTE_ARR_OFF
public byte[] allocate(int size)
allocate in interface PortableMemoryAllocatorsize - Size.public byte[] reallocate(byte[] data,
int size)
reallocate in interface PortableMemoryAllocatordata - Current data chunk.size - New size required.public void release(byte[] data,
int maxMsgSize)
release in interface PortableMemoryAllocatordata - Data.maxMsgSize - Max message size sent during the time the allocator is used.public long allocateDirect(int size)
allocateDirect in interface PortableMemoryAllocatorsize - Size.public long reallocateDirect(long addr,
int size)
reallocateDirect in interface PortableMemoryAllocatoraddr - Address.size - Size.public void releaseDirect(long addr)
releaseDirect in interface PortableMemoryAllocatoraddr - Address.public boolean isThreadLocalArrayAcquired()
true if acquired false otherwise.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.4.0 Release Date : September 24 2015