Package org.lwjgl.util.spng
Class spng_alloc
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
struct spng_alloc {
{@link spng_malloc_fnI spng_malloc_fn} * malloc_fn;
{@link spng_realloc_fnI spng_realloc_fn} * realloc_fn;
{@link spng_calloc_fnI spng_calloc_fn} * calloc_fn;
{@link spng_free_fnI spng_free_fn} * free_fn;
}
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionspng_alloc
(ByteBuffer container) Creates aspng_alloc
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic spng_alloc
calloc()
Returns a newspng_alloc
instance allocated withmemCalloc
.static spng_alloc.Buffer
calloc
(int capacity) Returns a newspng_alloc.Buffer
instance allocated withmemCalloc
.static spng_alloc.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newspng_alloc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static spng_alloc
calloc
(MemoryStack stack) Returns a newspng_alloc
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.calloc_fn
(int capacity) calloc_fn
(PointerBuffer value) Sets the address of the specifiedPointerBuffer
to thecalloc_fn
field.static spng_alloc
create()
Returns a newspng_alloc
instance allocated withBufferUtils
.static spng_alloc.Buffer
create
(int capacity) Returns a newspng_alloc.Buffer
instance allocated withBufferUtils
.static spng_alloc
create
(long address) Returns a newspng_alloc
instance for the specified memory address.static spng_alloc.Buffer
create
(long address, int capacity) Create aspng_alloc.Buffer
instance at the specified memory.static @Nullable spng_alloc
createSafe
(long address) static @Nullable spng_alloc.Buffer
createSafe
(long address, int capacity) free_fn
(int capacity) free_fn
(PointerBuffer value) Sets the address of the specifiedPointerBuffer
to thefree_fn
field.static spng_alloc
malloc()
Returns a newspng_alloc
instance allocated withmemAlloc
.static spng_alloc.Buffer
malloc
(int capacity) Returns a newspng_alloc.Buffer
instance allocated withmemAlloc
.static spng_alloc.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newspng_alloc.Buffer
instance allocated on the specifiedMemoryStack
.static spng_alloc
malloc
(MemoryStack stack) Returns a newspng_alloc
instance allocated on the specifiedMemoryStack
.malloc_fn
(int capacity) malloc_fn
(PointerBuffer value) Sets the address of the specifiedPointerBuffer
to themalloc_fn
field.static PointerBuffer
ncalloc_fn
(long struct, int capacity) Unsafe version ofcalloc_fn
.static void
ncalloc_fn
(long struct, PointerBuffer value) Unsafe version ofcalloc_fn
.static PointerBuffer
nfree_fn
(long struct, int capacity) Unsafe version offree_fn
.static void
nfree_fn
(long struct, PointerBuffer value) Unsafe version offree_fn
.static PointerBuffer
nmalloc_fn
(long struct, int capacity) Unsafe version ofmalloc_fn
.static void
nmalloc_fn
(long struct, PointerBuffer value) Unsafe version ofmalloc_fn
.static PointerBuffer
nrealloc_fn
(long struct, int capacity) Unsafe version ofrealloc_fn
.static void
nrealloc_fn
(long struct, PointerBuffer value) Unsafe version ofrealloc_fn
.realloc_fn
(int capacity) realloc_fn
(PointerBuffer value) Sets the address of the specifiedPointerBuffer
to therealloc_fn
field.set
(PointerBuffer malloc_fn, PointerBuffer realloc_fn, PointerBuffer calloc_fn, PointerBuffer free_fn) Initializes this struct with the specified values.set
(spng_alloc src) Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.static void
validate
(long struct) Validates pointer members that should not beNULL
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
MALLOC_FN
public static final int MALLOC_FNThe struct member offsets. -
REALLOC_FN
public static final int REALLOC_FNThe struct member offsets. -
CALLOC_FN
public static final int CALLOC_FNThe struct member offsets. -
FREE_FN
public static final int FREE_FNThe struct member offsets.
-
-
Constructor Details
-
spng_alloc
Creates aspng_alloc
instance at the current position of the specifiedByteBuffer
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.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<spng_alloc>
-
malloc_fn
- Returns:
- a
PointerBuffer
view of the data pointed to by themalloc_fn
field.
-
realloc_fn
- Returns:
- a
PointerBuffer
view of the data pointed to by therealloc_fn
field.
-
calloc_fn
- Returns:
- a
PointerBuffer
view of the data pointed to by thecalloc_fn
field.
-
free_fn
- Returns:
- a
PointerBuffer
view of the data pointed to by thefree_fn
field.
-
malloc_fn
Sets the address of the specifiedPointerBuffer
to themalloc_fn
field. -
realloc_fn
Sets the address of the specifiedPointerBuffer
to therealloc_fn
field. -
calloc_fn
Sets the address of the specifiedPointerBuffer
to thecalloc_fn
field. -
free_fn
Sets the address of the specifiedPointerBuffer
to thefree_fn
field. -
set
public spng_alloc set(PointerBuffer malloc_fn, PointerBuffer realloc_fn, PointerBuffer calloc_fn, PointerBuffer free_fn) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newspng_alloc
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newspng_alloc
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newspng_alloc
instance allocated withBufferUtils
. -
create
Returns a newspng_alloc
instance for the specified memory address. -
createSafe
-
malloc
Returns a newspng_alloc.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newspng_alloc.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newspng_alloc.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aspng_alloc.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newspng_alloc
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newspng_alloc
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newspng_alloc.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newspng_alloc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nmalloc_fn
Unsafe version ofmalloc_fn
. -
nrealloc_fn
Unsafe version ofrealloc_fn
. -
ncalloc_fn
Unsafe version ofcalloc_fn
. -
nfree_fn
Unsafe version offree_fn
. -
nmalloc_fn
Unsafe version ofmalloc_fn
. -
nrealloc_fn
Unsafe version ofrealloc_fn
. -
ncalloc_fn
Unsafe version ofcalloc_fn
. -
nfree_fn
Unsafe version offree_fn
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-