Class NkMemoryStatus

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

    public class NkMemoryStatus
    extends Struct
    implements NativeResource


     struct nk_memory_status {
         void * memory;
         unsigned int type;
         nk_size size;
         nk_size allocated;
         nk_size needed;
         nk_size calls;
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.

        The struct member offsets.
    • Constructor Detail

      • NkMemoryStatus

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

        public java.nio.ByteBuffer memory()
        Returns a ByteBuffer view of the data pointed to by the memory field.
      • type

        public int type()
        Returns the value of the type field.
      • size

        public long size()
        Returns the value of the size field.
      • allocated

        public long allocated()
        Returns the value of the allocated field.
      • needed

        public long needed()
        Returns the value of the needed field.
      • calls

        public long calls()
        Returns the value of the calls field.
      • createSafe

        public static NkMemoryStatus createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static NkMemoryStatus.Buffer create​(long address,
                                                   int capacity)
        Create a NkMemoryStatus.Buffer instance at the specified memory.
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        public static NkMemoryStatus.Buffer createSafe​(long address,
                                                       int capacity)
        Like create, but returns null if address is NULL.
      • nmemory

        public static java.nio.ByteBuffer nmemory​(long struct)
        Unsafe version of memory.
      • ntype

        public static int ntype​(long struct)
        Unsafe version of type().
      • nsize

        public static long nsize​(long struct)
        Unsafe version of size().
      • nallocated

        public static long nallocated​(long struct)
        Unsafe version of allocated().
      • nneeded

        public static long nneeded​(long struct)
        Unsafe version of needed().
      • ncalls

        public static long ncalls​(long struct)
        Unsafe version of calls().