Class 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.

    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()
        Specified by:
        sizeof in class org.lwjgl.system.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()
        Returns a new BGFXAllocatorInterface instance allocated with BufferUtils.
      • 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.
      • malloc

        public static BGFXAllocatorInterface malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new BGFXAllocatorInterface instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static BGFXAllocatorInterface calloc​(org.lwjgl.system.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