public class Buffer extends Object
Constructor and Description |
---|
Buffer() |
Modifier and Type | Method and Description |
---|---|
static long |
address(ByteBuffer buf)
Returns the memory address of the ByteBuffer.
|
static ByteBuffer |
calloc(int num,
int size)
Allocate a new ByteBuffer from memory and set all of the memory to 0
|
static ByteBuffer |
create(long mem,
int size)
Allocate a new ByteBuffer from already allocated memory.
|
static void |
free(ByteBuffer buf)
Deallocates or frees a memory block used by ByteBuffer
Warning : Call this method only on ByteBuffers that were created by calling Buffer.alloc or Buffer.calloc. |
static ByteBuffer |
malloc(int size)
Allocate a new ByteBuffer from memory
|
static ByteBuffer |
palloc(long p,
int size)
Allocate a new ByteBuffer from a pool
|
static ByteBuffer |
pcalloc(long p,
int size)
Allocate a new ByteBuffer from a pool and set all of the memory to 0
|
static long |
size(ByteBuffer buf)
Returns the allocated memory size of the ByteBuffer.
|
public static ByteBuffer malloc(int size)
size
- The amount of memory to allocatepublic static ByteBuffer calloc(int num, int size)
num
- Number of elements.size
- Length in bytes of each element.public static ByteBuffer palloc(long p, int size)
p
- The pool to allocate fromsize
- The amount of memory to allocatepublic static ByteBuffer pcalloc(long p, int size)
p
- The pool to allocate fromsize
- The amount of memory to allocatepublic static ByteBuffer create(long mem, int size)
mem
- The memory to usesize
- The amount of memory to usepublic static void free(ByteBuffer buf)
buf
- Previously allocated ByteBuffer to be freed.public static long address(ByteBuffer buf)
buf
- Previously allocated ByteBuffer.public static long size(ByteBuffer buf)
buf
- Previously allocated ByteBuffer.Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.