public class PlatformMemoryUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_ACQUIRED
Flag: whether this pooled memory chunk is acquired.
|
static int |
FLAG_EXT
Flag: external.
|
static int |
FLAG_POOLED
Flag: pooled.
|
static int |
MEM_HDR_LEN
Memory chunk header length.
|
static int |
MEM_HDR_OFF_CAP
Offset: capacity.
|
static int |
MEM_HDR_OFF_FLAGS
Offset: flags.
|
static int |
MEM_HDR_OFF_LEN
Offset: length.
|
static int |
POOL_HDR_LEN
Header length.
|
static int |
POOL_HDR_OFF_MEM_1
Pool header offset: first memory chunk.
|
static int |
POOL_HDR_OFF_MEM_2
Pool header offset: second memory chunk.
|
static int |
POOL_HDR_OFF_MEM_3
Pool header offset: third memory chunk.
|
Modifier and Type | Method and Description |
---|---|
static long |
allocatePool()
Allocate pool memory.
|
static long |
allocatePooled(long poolPtr,
int cap)
Allocate pooled memory chunk.
|
static long |
allocateUnpooled(int cap)
Allocate unpooled memory chunk.
|
static int |
capacity(long memPtr)
Gets capacity for the given memory chunk.
|
static void |
capacity(long memPtr,
int cap)
Sets capacity for the given memory chunk.
|
static long |
data(long memPtr)
Gets data pointer for the given memory chunk.
|
static int |
flags(long memPtr)
Gets flags for the given memory chunk.
|
static void |
flags(long memPtr,
int flags)
Sets flags for the given memory chunk.
|
static boolean |
isAcquired(int flags)
Check whether flags denote pooled and acquired memory chunk.
|
static boolean |
isAcquired(long memPtr)
Check whether this memory chunk is pooled and acquired.
|
static boolean |
isExternal(int flags)
Check whether flags denote that this memory chunk is external.
|
static boolean |
isExternal(long memPtr)
Check whether this memory chunk is external.
|
static boolean |
isPooled(int flags)
Check whether flags denote pooled memory chunk.
|
static boolean |
isPooled(long memPtr)
Check whether this memory chunk is pooled.
|
static int |
length(long memPtr)
Gets length for the given memory chunk.
|
static void |
length(long memPtr,
int len)
Sets length for the given memory chunk.
|
static void |
reallocate(long memPtr,
int cap)
Reallocate arbitrary memory chunk.
|
static void |
reallocatePooled(long memPtr,
int cap)
Reallocate pooled memory chunk.
|
static void |
reallocateUnpooled(long memPtr,
int cap)
Reallocate unpooled memory chunk.
|
static void |
releasePool(long poolPtr)
Release pool memory.
|
static void |
releasePooled(long memPtr)
Release pooled memory chunk.
|
static void |
releaseUnpooled(long memPtr)
Release unpooled memory chunk.
|
public static final int POOL_HDR_LEN
public static final int POOL_HDR_OFF_MEM_1
public static final int POOL_HDR_OFF_MEM_2
public static final int POOL_HDR_OFF_MEM_3
public static final int MEM_HDR_LEN
public static final int MEM_HDR_OFF_CAP
public static final int MEM_HDR_OFF_LEN
public static final int MEM_HDR_OFF_FLAGS
public static final int FLAG_EXT
public static final int FLAG_POOLED
public static final int FLAG_ACQUIRED
public static long data(long memPtr)
memPtr
- Memory pointer.public static int capacity(long memPtr)
memPtr
- Memory pointer.public static void capacity(long memPtr, int cap)
memPtr
- Memory pointer.cap
- Capacity.public static int length(long memPtr)
memPtr
- Memory pointer.public static void length(long memPtr, int len)
memPtr
- Memory pointer.len
- Length.public static int flags(long memPtr)
memPtr
- Memory pointer.public static void flags(long memPtr, int flags)
memPtr
- Memory pointer.flags
- Flags.public static boolean isExternal(long memPtr)
memPtr
- Memory pointer.True
if owned by native platform.public static boolean isExternal(int flags)
flags
- Flags.True
if owned by native platform.public static boolean isPooled(long memPtr)
memPtr
- Memory pointer.True
if pooled.public static boolean isPooled(int flags)
flags
- Flags.True
if pooled.public static boolean isAcquired(long memPtr)
memPtr
- Memory pointer.True
if pooled and acquired.public static boolean isAcquired(int flags)
flags
- Flags.True
if acquired.public static long allocateUnpooled(int cap)
cap
- Minimum capacity.public static void reallocateUnpooled(long memPtr, int cap)
memPtr
- Memory pointer.cap
- Minimum capacity.public static void releaseUnpooled(long memPtr)
memPtr
- Memory pointer.public static long allocatePool()
public static void releasePool(long poolPtr)
poolPtr
- Pool pointer.public static long allocatePooled(long poolPtr, int cap)
poolPtr
- Pool pointer.cap
- Capacity.0
in case there are no free memory chunks in the pool.public static void reallocatePooled(long memPtr, int cap)
memPtr
- Memory pointer.cap
- Minimum capacity.public static void releasePooled(long memPtr)
memPtr
- Memory pointer.public static void reallocate(long memPtr, int cap)
memPtr
- Memory pointer.cap
- Capacity.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017