Package org.lwjgl.bgfx
Class BGFXAllocatorInterface
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.bgfx.BGFXAllocatorInterface
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class BGFXAllocatorInterface extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Custom allocator. When custom allocator is not specified, library uses default CRT allocator. The library assumes custom allocator is thread safe.Member documentation
vtbl
– the allocator virtual table
Layout
struct bgfx_allocator_interface_t {
bgfx_allocator_vtbl_t
const * vtbl; }
-
-
Constructor Summary
Constructors Constructor Description BGFXAllocatorInterface(java.nio.ByteBuffer container)
Creates aBGFXAllocatorInterface
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BGFXAllocatorInterface
calloc()
Returns a newBGFXAllocatorInterface
instance allocated withmemCalloc
.static BGFXAllocatorInterface
callocStack()
Returns a newBGFXAllocatorInterface
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXAllocatorInterface
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.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
mallocStack()
Returns a newBGFXAllocatorInterface
instance allocated on the thread-localMemoryStack
.static BGFXAllocatorInterface
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
.static BGFXAllocatorVtbl
nvtbl(long struct)
Unsafe version ofvtbl()
.static void
nvtbl(long struct, BGFXAllocatorVtbl value)
Unsafe version ofvtbl
.BGFXAllocatorInterface
set(BGFXAllocatorInterface src)
Copies the specified struct data to this struct.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.BGFXAllocatorVtbl
vtbl()
Returns aBGFXAllocatorVtbl
view of the struct pointed to by thevtbl
field.BGFXAllocatorInterface
vtbl(BGFXAllocatorVtbl value)
Sets the address of the specifiedBGFXAllocatorVtbl
to thevtbl
field.
-
-
-
Constructor Detail
-
BGFXAllocatorInterface
public BGFXAllocatorInterface(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
vtbl
public BGFXAllocatorVtbl vtbl()
Returns aBGFXAllocatorVtbl
view of the struct pointed to by thevtbl
field.
-
vtbl
public BGFXAllocatorInterface vtbl(BGFXAllocatorVtbl value)
Sets the address of the specifiedBGFXAllocatorVtbl
to thevtbl
field.
-
set
public BGFXAllocatorInterface set(BGFXAllocatorInterface src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static BGFXAllocatorInterface malloc()
Returns a newBGFXAllocatorInterface
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static BGFXAllocatorInterface calloc()
Returns a newBGFXAllocatorInterface
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static BGFXAllocatorInterface create()
Returns a newBGFXAllocatorInterface
instance allocated withBufferUtils
.
-
create
public static BGFXAllocatorInterface create(long address)
Returns a newBGFXAllocatorInterface
instance for the specified memory address.
-
createSafe
@Nullable public static BGFXAllocatorInterface createSafe(long address)
-
mallocStack
public static BGFXAllocatorInterface mallocStack()
Returns a newBGFXAllocatorInterface
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static BGFXAllocatorInterface callocStack()
Returns a newBGFXAllocatorInterface
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static BGFXAllocatorInterface mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static BGFXAllocatorInterface callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXAllocatorInterface
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
nvtbl
public static BGFXAllocatorVtbl nvtbl(long struct)
Unsafe version ofvtbl()
.
-
nvtbl
public static void nvtbl(long struct, BGFXAllocatorVtbl value)
Unsafe version ofvtbl
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-