Package org.lwjgl.bgfx
Class BGFXAllocatorInterface
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
public class BGFXAllocatorInterface
extends Struct<BGFXAllocatorInterface>
implements NativeResource
Custom allocator. When custom allocator is not specified, library uses default CRT allocator. The library assumes custom allocator is thread safe.
Layout
struct bgfx_allocator_interface_t {
bgfx_allocator_vtbl_t
const * vtbl()
;
}
-
Nested Class Summary
Nested 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
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct size in bytes.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionBGFXAllocatorInterface
(ByteBuffer container) Creates aBGFXAllocatorInterface
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic BGFXAllocatorInterface
calloc()
Returns a newBGFXAllocatorInterface
instance allocated withmemCalloc
.static BGFXAllocatorInterface
calloc
(MemoryStack stack) Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXAllocatorInterface
Deprecated.static BGFXAllocatorInterface
callocStack
(MemoryStack stack) Deprecated.static BGFXAllocatorInterface
create()
Returns a newBGFXAllocatorInterface
instance allocated withBufferUtils
.static BGFXAllocatorInterface
create
(long address) Returns a newBGFXAllocatorInterface
instance for the specified memory address.static BGFXAllocatorInterface
createSafe
(long address) static BGFXAllocatorInterface
malloc()
Returns a newBGFXAllocatorInterface
instance allocated withmemAlloc
.static BGFXAllocatorInterface
malloc
(MemoryStack stack) Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
.static BGFXAllocatorInterface
Deprecated.static BGFXAllocatorInterface
mallocStack
(MemoryStack stack) Deprecated.static BGFXAllocatorVtbl
nvtbl
(long struct) Unsafe version ofvtbl()
.static void
nvtbl
(long struct, BGFXAllocatorVtbl value) Unsafe version ofvtbl
.Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.static void
validate
(long struct) Validates pointer members that should not beNULL
.vtbl()
the allocator virtual tablevtbl
(BGFXAllocatorVtbl value) Sets the address of the specifiedBGFXAllocatorVtbl
to thevtbl()
field.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. -
VTBL
public static final int VTBLThe struct member offsets.
-
-
Constructor Details
-
BGFXAllocatorInterface
Creates aBGFXAllocatorInterface
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<BGFXAllocatorInterface>
-
vtbl
the allocator virtual table -
vtbl
Sets the address of the specifiedBGFXAllocatorVtbl
to thevtbl()
field. -
set
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newBGFXAllocatorInterface
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newBGFXAllocatorInterface
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newBGFXAllocatorInterface
instance allocated withBufferUtils
. -
create
Returns a newBGFXAllocatorInterface
instance for the specified memory address. -
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
malloc
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
nvtbl
Unsafe version ofvtbl()
. -
nvtbl
Unsafe version ofvtbl
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-