Package org.lwjgl.util.spng
Class spng_alloc
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct spng_alloc {
spng_malloc_fn * malloc_fn;
spng_realloc_fn * realloc_fn;
spng_calloc_fn * calloc_fn;
spng_free_fn * free_fn;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe 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_allocinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic spng_alloccalloc()Returns a newspng_allocinstance allocated withmemCalloc.static spng_alloc.Buffercalloc(int capacity) Returns a newspng_alloc.Bufferinstance allocated withmemCalloc.static spng_alloc.Buffercalloc(int capacity, MemoryStack stack) Returns a newspng_alloc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static spng_alloccalloc(MemoryStack stack) Returns a newspng_allocinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.calloc_fn(int capacity) calloc_fn(PointerBuffer value) Sets the address of the specifiedPointerBufferto thecalloc_fnfield.static spng_alloccreate()Returns a newspng_allocinstance allocated withBufferUtils.static spng_alloc.Buffercreate(int capacity) Returns a newspng_alloc.Bufferinstance allocated withBufferUtils.static spng_alloccreate(long address) Returns a newspng_allocinstance for the specified memory address.static spng_alloc.Buffercreate(long address, int capacity) Create aspng_alloc.Bufferinstance at the specified memory.static @Nullable spng_alloccreateSafe(long address) static @Nullable spng_alloc.BuffercreateSafe(long address, int capacity) free_fn(int capacity) free_fn(PointerBuffer value) Sets the address of the specifiedPointerBufferto thefree_fnfield.static spng_allocmalloc()Returns a newspng_allocinstance allocated withmemAlloc.static spng_alloc.Buffermalloc(int capacity) Returns a newspng_alloc.Bufferinstance allocated withmemAlloc.static spng_alloc.Buffermalloc(int capacity, MemoryStack stack) Returns a newspng_alloc.Bufferinstance allocated on the specifiedMemoryStack.static spng_allocmalloc(MemoryStack stack) Returns a newspng_allocinstance allocated on the specifiedMemoryStack.malloc_fn(int capacity) malloc_fn(PointerBuffer value) Sets the address of the specifiedPointerBufferto themalloc_fnfield.static PointerBufferncalloc_fn(long struct, int capacity) Unsafe version ofcalloc_fn.static voidncalloc_fn(long struct, PointerBuffer value) Unsafe version ofcalloc_fn.static PointerBuffernfree_fn(long struct, int capacity) Unsafe version offree_fn.static voidnfree_fn(long struct, PointerBuffer value) Unsafe version offree_fn.static PointerBuffernmalloc_fn(long struct, int capacity) Unsafe version ofmalloc_fn.static voidnmalloc_fn(long struct, PointerBuffer value) Unsafe version ofmalloc_fn.static PointerBuffernrealloc_fn(long struct, int capacity) Unsafe version ofrealloc_fn.static voidnrealloc_fn(long struct, PointerBuffer value) Unsafe version ofrealloc_fn.realloc_fn(int capacity) realloc_fn(PointerBuffer value) Sets the address of the specifiedPointerBufferto therealloc_fnfield.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.intsizeof()Returnssizeof(struct).static voidvalidate(long struct) Validates pointer members that should not beNULL.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods 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_allocinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<spng_alloc>
-
malloc_fn
- Returns:
- a
PointerBufferview of the data pointed to by themalloc_fnfield.
-
realloc_fn
- Returns:
- a
PointerBufferview of the data pointed to by therealloc_fnfield.
-
calloc_fn
- Returns:
- a
PointerBufferview of the data pointed to by thecalloc_fnfield.
-
free_fn
- Returns:
- a
PointerBufferview of the data pointed to by thefree_fnfield.
-
malloc_fn
Sets the address of the specifiedPointerBufferto themalloc_fnfield. -
realloc_fn
Sets the address of the specifiedPointerBufferto therealloc_fnfield. -
calloc_fn
Sets the address of the specifiedPointerBufferto thecalloc_fnfield. -
free_fn
Sets the address of the specifiedPointerBufferto thefree_fnfield. -
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_allocinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newspng_allocinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newspng_allocinstance allocated withBufferUtils. -
create
Returns a newspng_allocinstance for the specified memory address. -
createSafe
-
malloc
Returns a newspng_alloc.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newspng_alloc.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newspng_alloc.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aspng_alloc.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newspng_allocinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newspng_allocinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newspng_alloc.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newspng_alloc.Bufferinstance allocated on the specifiedMemoryStackand 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
-