public class NkAllocator
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
struct nk_allocator {
nk_handle userdata;
nk_plugin_alloc alloc;
nk_plugin_free mfree;
}| Modifier and Type | Class and Description |
|---|---|
static class |
NkAllocator.Buffer
An array of
NkAllocator structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ALLOC
The struct member offsets.
|
static int |
MFREE
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
USERDATA
The struct member offsets.
|
| Constructor and Description |
|---|
NkAllocator(java.nio.ByteBuffer container)
Creates a
NkAllocator instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
NkPluginAlloc |
alloc()
Returns the value of the
alloc field. |
NkAllocator |
alloc(NkPluginAllocI value)
Sets the specified value to the
alloc field. |
static NkAllocator |
calloc()
Returns a new
NkAllocator instance allocated with memCalloc. |
static NkAllocator.Buffer |
calloc(int capacity)
Returns a new
NkAllocator.Buffer instance allocated with memCalloc. |
static NkAllocator |
callocStack()
Returns a new
NkAllocator instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkAllocator.Buffer |
callocStack(int capacity)
Returns a new
NkAllocator.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkAllocator.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkAllocator.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkAllocator |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkAllocator instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkAllocator |
create()
Returns a new
NkAllocator instance allocated with BufferUtils. |
static NkAllocator.Buffer |
create(int capacity)
Returns a new
NkAllocator.Buffer instance allocated with BufferUtils. |
static NkAllocator |
create(long address)
Returns a new
NkAllocator instance for the specified memory address. |
static NkAllocator.Buffer |
create(long address,
int capacity)
Create a
NkAllocator.Buffer instance at the specified memory. |
static NkAllocator |
createSafe(long address)
|
static NkAllocator.Buffer |
createSafe(long address,
int capacity)
|
static NkAllocator |
malloc()
Returns a new
NkAllocator instance allocated with memAlloc. |
static NkAllocator.Buffer |
malloc(int capacity)
Returns a new
NkAllocator.Buffer instance allocated with memAlloc. |
static NkAllocator |
mallocStack()
Returns a new
NkAllocator instance allocated on the thread-local MemoryStack. |
static NkAllocator.Buffer |
mallocStack(int capacity)
Returns a new
NkAllocator.Buffer instance allocated on the thread-local MemoryStack. |
static NkAllocator.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkAllocator.Buffer instance allocated on the specified MemoryStack. |
static NkAllocator |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkAllocator instance allocated on the specified MemoryStack. |
NkPluginFree |
mfree()
Returns the value of the
mfree field. |
NkAllocator |
mfree(NkPluginFreeI value)
Sets the specified value to the
mfree field. |
static NkPluginAlloc |
nalloc(long struct)
Unsafe version of
alloc(). |
static void |
nalloc(long struct,
NkPluginAllocI value)
Unsafe version of
alloc. |
static NkPluginFree |
nmfree(long struct)
Unsafe version of
mfree(). |
static void |
nmfree(long struct,
NkPluginFreeI value)
Unsafe version of
mfree. |
static NkHandle |
nuserdata(long struct)
Unsafe version of
userdata(). |
static void |
nuserdata(long struct,
NkHandle value)
Unsafe version of
userdata. |
NkAllocator |
set(NkAllocator src)
Copies the specified struct data to this struct.
|
NkAllocator |
set(NkHandle userdata,
NkPluginAllocI alloc,
NkPluginFreeI mfree)
Initializes this struct with the specified values.
|
int |
sizeof() |
NkHandle |
userdata()
Returns a
NkHandle view of the userdata field. |
NkAllocator |
userdata(java.util.function.Consumer<NkHandle> consumer)
Passes the
userdata field to the specified Consumer. |
NkAllocator |
userdata(NkHandle value)
Copies the specified
NkHandle to the userdata field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int USERDATA
public static final int ALLOC
public static final int MFREE
public NkAllocator(java.nio.ByteBuffer container)
NkAllocator instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be
visible to the struct instance and vice versa.
The created instance holds a strong reference to the container object.
public int sizeof()
sizeof in class org.lwjgl.system.Struct@Nullable public NkPluginAlloc alloc()
alloc field.@Nullable public NkPluginFree mfree()
mfree field.public NkAllocator userdata(NkHandle value)
NkHandle to the userdata field.public NkAllocator userdata(java.util.function.Consumer<NkHandle> consumer)
userdata field to the specified Consumer.public NkAllocator alloc(@Nullable NkPluginAllocI value)
alloc field.public NkAllocator mfree(@Nullable NkPluginFreeI value)
mfree field.public NkAllocator set(NkHandle userdata, NkPluginAllocI alloc, NkPluginFreeI mfree)
public NkAllocator set(NkAllocator src)
src - the source structpublic static NkAllocator malloc()
NkAllocator instance allocated with memAlloc. The instance must be explicitly freed.public static NkAllocator calloc()
NkAllocator instance allocated with memCalloc. The instance must be explicitly freed.public static NkAllocator create()
NkAllocator instance allocated with BufferUtils.public static NkAllocator create(long address)
NkAllocator instance for the specified memory address.@Nullable public static NkAllocator createSafe(long address)
public static NkAllocator.Buffer malloc(int capacity)
NkAllocator.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkAllocator.Buffer calloc(int capacity)
NkAllocator.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkAllocator.Buffer create(int capacity)
NkAllocator.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static NkAllocator.Buffer create(long address, int capacity)
NkAllocator.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static NkAllocator.Buffer createSafe(long address, int capacity)
public static NkAllocator mallocStack()
NkAllocator instance allocated on the thread-local MemoryStack.public static NkAllocator callocStack()
NkAllocator instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static NkAllocator mallocStack(org.lwjgl.system.MemoryStack stack)
NkAllocator instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static NkAllocator callocStack(org.lwjgl.system.MemoryStack stack)
NkAllocator instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static NkAllocator.Buffer mallocStack(int capacity)
NkAllocator.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static NkAllocator.Buffer callocStack(int capacity)
NkAllocator.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static NkAllocator.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkAllocator.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkAllocator.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkAllocator.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkHandle nuserdata(long struct)
userdata().@Nullable public static NkPluginAlloc nalloc(long struct)
alloc().@Nullable public static NkPluginFree nmfree(long struct)
mfree().public static void nalloc(long struct,
@Nullable
NkPluginAllocI value)
alloc.public static void nmfree(long struct,
@Nullable
NkPluginFreeI value)
mfree.Copyright LWJGL. All Rights Reserved. License terms.