Class BGFXAllocatorInterface

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class BGFXAllocatorInterface
    extends Struct
    implements 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;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
      • ALIGNOF

        public static final int ALIGNOF
        The struct alignment in bytes.
      • VTBL

        public static final int VTBL
        The struct member offsets.
    • Constructor Detail

      • BGFXAllocatorInterface

        public BGFXAllocatorInterface​(java.nio.ByteBuffer container)
        Creates a BGFXAllocatorInterface 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.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • malloc

        public static BGFXAllocatorInterface malloc()
        Returns a new BGFXAllocatorInterface instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static BGFXAllocatorInterface calloc()
        Returns a new BGFXAllocatorInterface instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static BGFXAllocatorInterface create​(long address)
        Returns a new BGFXAllocatorInterface instance for the specified memory address.
      • createSafe

        @Nullable
        public static BGFXAllocatorInterface createSafe​(long address)
        Like create, but returns null if address is NULL.
      • callocStack

        public static BGFXAllocatorInterface callocStack()
        Returns a new BGFXAllocatorInterface instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static BGFXAllocatorInterface mallocStack​(MemoryStack stack)
        Returns a new BGFXAllocatorInterface instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static BGFXAllocatorInterface callocStack​(MemoryStack stack)
        Returns a new BGFXAllocatorInterface instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array