Class XXH3State

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

    public class XXH3State
    extends Struct
    implements NativeResource
    XXH3 state for stack allocation. Unstable API.

    Layout

    
     struct XXH3_state_t {
         XXH32_hash_t acc[8];
         char customSecret[192];
         char buffer[256];
         void const * secret;
         XXH32_hash_t bufferedSize;
         XXH32_hash_t nbStripesPerBlock;
         XXH32_hash_t nbStripesSoFar;
         XXH32_hash_t reserved32;
         XXH32_hash_t reserved32_2;
         XXH32_hash_t secretLimit;
         XXH32_hash_t totalLen;
         XXH32_hash_t seed;
         XXH32_hash_t reserved64;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ACC, CUSTOMSECRET, BUFFER, SECRET, BUFFEREDSIZE, NBSTRIPESPERBLOCK, NBSTRIPESSOFAR, RESERVED32, RESERVED32_2, SECRETLIMIT, TOTALLEN, SEED, RESERVED64

        The struct member offsets.
    • Constructor Detail

      • XXH3State

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

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

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

        public java.nio.ByteBuffer customSecret()
        Returns a ByteBuffer view of the customSecret field.
      • customSecret

        public byte customSecret​(int index)
        Returns the value at the specified index of the customSecret field.
      • buffer

        public java.nio.ByteBuffer buffer()
        Returns a ByteBuffer view of the buffer field.
      • buffer

        public byte buffer​(int index)
        Returns the value at the specified index of the buffer field.
      • secret

        public java.nio.ByteBuffer secret​(int capacity)
        Returns a ByteBuffer view of the data pointed to by the secret field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • bufferedSize

        public int bufferedSize()
        Returns the value of the bufferedSize field.
      • nbStripesPerBlock

        public int nbStripesPerBlock()
        Returns the value of the nbStripesPerBlock field.
      • nbStripesSoFar

        public int nbStripesSoFar()
        Returns the value of the nbStripesSoFar field.
      • reserved32

        public int reserved32()
        Returns the value of the reserved32 field.
      • reserved32_2

        public int reserved32_2()
        Returns the value of the reserved32_2 field.
      • secretLimit

        public int secretLimit()
        Returns the value of the secretLimit field.
      • totalLen

        public long totalLen()
        Returns the value of the totalLen field.
      • seed

        public long seed()
        Returns the value of the seed field.
      • reserved64

        public long reserved64()
        Returns the value of the reserved64 field.
      • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static XXH3State.Buffer callocStack​(int capacity,
                                                   MemoryStack stack)
        Returns a new XXH3State.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
      • nacc

        public static java.nio.LongBuffer nacc​(long struct)
        Unsafe version of acc().
      • nacc

        public static long nacc​(long struct,
                                int index)
        Unsafe version of acc.
      • ncustomSecret

        public static java.nio.ByteBuffer ncustomSecret​(long struct)
        Unsafe version of customSecret().
      • ncustomSecret

        public static byte ncustomSecret​(long struct,
                                         int index)
        Unsafe version of customSecret.
      • nbuffer

        public static java.nio.ByteBuffer nbuffer​(long struct)
        Unsafe version of buffer().
      • nbuffer

        public static byte nbuffer​(long struct,
                                   int index)
        Unsafe version of buffer.
      • nsecret

        public static java.nio.ByteBuffer nsecret​(long struct,
                                                  int capacity)
        Unsafe version of secret.
      • nbufferedSize

        public static int nbufferedSize​(long struct)
        Unsafe version of bufferedSize().
      • nnbStripesPerBlock

        public static int nnbStripesPerBlock​(long struct)
        Unsafe version of nbStripesPerBlock().
      • nnbStripesSoFar

        public static int nnbStripesSoFar​(long struct)
        Unsafe version of nbStripesSoFar().
      • nreserved32

        public static int nreserved32​(long struct)
        Unsafe version of reserved32().
      • nreserved32_2

        public static int nreserved32_2​(long struct)
        Unsafe version of reserved32_2().
      • nsecretLimit

        public static int nsecretLimit​(long struct)
        Unsafe version of secretLimit().
      • ntotalLen

        public static long ntotalLen​(long struct)
        Unsafe version of totalLen().
      • nseed

        public static long nseed​(long struct)
        Unsafe version of seed().
      • nreserved64

        public static long nreserved64​(long struct)
        Unsafe version of reserved64().