Class XXH64State

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

    public class XXH64State
    extends Struct
    implements NativeResource
    64-bit XXH state for stack allocation. Unstable API.

    Layout

    
     struct XXH64_state_t {
         XXH32_hash_t total_len;
         XXH32_hash_t v1;
         XXH32_hash_t v2;
         XXH32_hash_t v3;
         XXH32_hash_t v4;
         XXH32_hash_t mem64[4];
         XXH32_hash_t memsize;
         XXH32_hash_t reserved[2];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TOTAL_LEN, V1, V2, V3, V4, MEM64, MEMSIZE, RESERVED

        The struct member offsets.
    • Constructor Detail

      • XXH64State

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

        public long total_len()
        Returns the value of the total_len field.
      • v1

        public long v1()
        Returns the value of the v1 field.
      • v2

        public long v2()
        Returns the value of the v2 field.
      • v3

        public long v3()
        Returns the value of the v3 field.
      • v4

        public long v4()
        Returns the value of the v4 field.
      • mem64

        public java.nio.LongBuffer mem64()
        Returns a LongBuffer view of the mem64 field.
      • mem64

        public long mem64​(int index)
        Returns the value at the specified index of the mem64 field.
      • memsize

        public int memsize()
        Returns the value of the memsize field.
      • reserved

        public java.nio.IntBuffer reserved()
        Returns a IntBuffer view of the reserved field.
      • reserved

        public int reserved​(int index)
        Returns the value at the specified index of the reserved field.
      • malloc

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

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

        public static XXH64State create()
        Returns a new XXH64State instance allocated with BufferUtils.
      • create

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

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

        public static XXH64State.Buffer malloc​(int capacity)
        Returns a new XXH64State.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static XXH64State.Buffer calloc​(int capacity)
        Returns a new XXH64State.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

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

        @Nullable
        public static XXH64State.Buffer createSafe​(long address,
                                                   int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static XXH64State mallocStack()
        Returns a new XXH64State instance allocated on the thread-local MemoryStack.
      • callocStack

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

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

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

        public static XXH64State.Buffer callocStack​(int capacity)
        Returns a new XXH64State.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static XXH64State.Buffer callocStack​(int capacity,
                                                    MemoryStack stack)
        Returns a new XXH64State.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ntotal_len

        public static long ntotal_len​(long struct)
        Unsafe version of total_len().
      • nv1

        public static long nv1​(long struct)
        Unsafe version of v1().
      • nv2

        public static long nv2​(long struct)
        Unsafe version of v2().
      • nv3

        public static long nv3​(long struct)
        Unsafe version of v3().
      • nv4

        public static long nv4​(long struct)
        Unsafe version of v4().
      • nmem64

        public static java.nio.LongBuffer nmem64​(long struct)
        Unsafe version of mem64().
      • nmem64

        public static long nmem64​(long struct,
                                  int index)
        Unsafe version of mem64.
      • nmemsize

        public static int nmemsize​(long struct)
        Unsafe version of memsize().
      • nreserved

        public static java.nio.IntBuffer nreserved​(long struct)
        Unsafe version of reserved().
      • nreserved

        public static int nreserved​(long struct,
                                    int index)
        Unsafe version of reserved.