Package org.lwjgl.util.xxhash
Class XXH3State
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.xxhash.XXH3State
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XXH3State extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceThe state struct for the XXH3 streaming API.This structure has a strict alignment requirement of 64 bytes! Do not allocate this with
malloc(), it will not be sufficiently aligned. UseXXHash.XXH3_createState()andXXHash.XXH3_freeState(org.lwjgl.util.xxhash.XXH3State), or stack allocation.Layout
struct XXH3_state_t { XXH64_hash_tacc()[8]; unsigned charcustomSecret()[XXH3_SECRET_DEFAULT_SIZE]; char[64 - (XXH3_SECRET_DEFAULT_SIZE & 63)]; unsigned charbuffer()[256]; XXH32_hash_tbufferedSize(); XXH32_hash_tuseSeed(); size_tnbStripesSoFar(); XXH64_hash_ttotalLen(); size_tnbStripesPerBlock(); size_tsecretLimit(); XXH64_hash_tseed(); XXH64_hash_treserved64(); unsigned char const *extSecret(int); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXXH3State.BufferAn array ofXXH3Statestructs.
-
Field Summary
Fields Modifier and Type Field Description static intACCThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intBUFFER
BUFFEREDSIZE
CUSTOMSECRET
EXTSECRET
NBSTRIPESPERBLOCK
NBSTRIPESSOFAR
RESERVED64
SECRETLIMIT
SEEDThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTOTALLEN
USESEEDThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description XXH3State(java.nio.ByteBuffer container)Creates aXXH3Stateinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.LongBufferacc()the 8 accumulators.longacc(int index)the 8 accumulators.java.nio.ByteBufferbuffer()the internal buffer.bytebuffer(int index)the internal buffer.intbufferedSize()the amount of memory inbuffer, SeeXXH32_state_s::memsize.static XXH3Statecalloc()Returns a newXXH3Stateinstance allocated withmemCalloc.static XXH3State.Buffercalloc(int capacity)Returns a newXXH3State.Bufferinstance allocated withmemCalloc.static XXH3State.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XXH3Statecalloc(org.lwjgl.system.MemoryStack stack)Returns a newXXH3Stateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XXH3StatecallocStack()Deprecated.static XXH3State.BuffercallocStack(int capacity)Deprecated.static XXH3State.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static XXH3StatecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static XXH3Statecreate()Returns a newXXH3Stateinstance allocated withBufferUtils.static XXH3State.Buffercreate(int capacity)Returns a newXXH3State.Bufferinstance allocated withBufferUtils.static XXH3Statecreate(long address)Returns a newXXH3Stateinstance for the specified memory address.static XXH3State.Buffercreate(long address, int capacity)Create aXXH3State.Bufferinstance at the specified memory.static XXH3StatecreateSafe(long address)static XXH3State.BuffercreateSafe(long address, int capacity)java.nio.ByteBuffercustomSecret()used to store a custom secret generated from a seedbytecustomSecret(int index)used to store a custom secret generated from a seedjava.nio.ByteBufferextSecret(int capacity)static XXH3Statemalloc()Returns a newXXH3Stateinstance allocated withmemAlloc.static XXH3State.Buffermalloc(int capacity)Returns a newXXH3State.Bufferinstance allocated withmemAlloc.static XXH3State.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStack.static XXH3Statemalloc(org.lwjgl.system.MemoryStack stack)Returns a newXXH3Stateinstance allocated on the specifiedMemoryStack.static XXH3StatemallocStack()Deprecated.static XXH3State.BuffermallocStack(int capacity)Deprecated.static XXH3State.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static XXH3StatemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static java.nio.LongBuffernacc(long struct)Unsafe version ofacc().static longnacc(long struct, int index)Unsafe version ofacc.longnbStripesPerBlock()number of stripes per blocklongnbStripesSoFar()number or stripes processedstatic java.nio.ByteBuffernbuffer(long struct)Unsafe version ofbuffer().static bytenbuffer(long struct, int index)Unsafe version ofbuffer.static intnbufferedSize(long struct)Unsafe version ofbufferedSize().static java.nio.ByteBufferncustomSecret(long struct)Unsafe version ofcustomSecret().static bytencustomSecret(long struct, int index)Unsafe version ofcustomSecret.static java.nio.ByteBuffernextSecret(long struct, int capacity)Unsafe version ofextSecret.static longnnbStripesPerBlock(long struct)Unsafe version ofnbStripesPerBlock().static longnnbStripesSoFar(long struct)Unsafe version ofnbStripesSoFar().static longnreserved64(long struct)Unsafe version ofreserved64().static longnsecretLimit(long struct)Unsafe version ofsecretLimit().static longnseed(long struct)Unsafe version ofseed().static longntotalLen(long struct)Unsafe version oftotalLen().static intnuseSeed(long struct)Unsafe version ofuseSeed().longreserved64()reserved fieldlongsecretLimit()size ofcustomSecretorextSecretlongseed()seed for_withSeedvariants.intsizeof()longtotalLen()total length hashed.intuseSeed()reserved field.
-
-
-
Constructor Detail
-
XXH3State
public XXH3State(java.nio.ByteBuffer container)
Creates aXXH3Stateinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
acc
public java.nio.LongBuffer acc() public long acc(int index)
the 8 accumulators. Similar tovinXXH32_state_sandXXH64_state_s.
-
customSecret
public java.nio.ByteBuffer customSecret() public byte customSecret(int index)
used to store a custom secret generated from a seed
-
buffer
public java.nio.ByteBuffer buffer() public byte buffer(int index)
the internal buffer. SeeXXH32_state_s::mem32.
-
bufferedSize
public int bufferedSize()
the amount of memory inbuffer, SeeXXH32_state_s::memsize.
-
useSeed
public int useSeed()
reserved field. Needed for padding on 64-bit.
-
nbStripesSoFar
public long nbStripesSoFar()
number or stripes processed
-
totalLen
public long totalLen()
total length hashed. 64-bit even on 32-bit targets.
-
nbStripesPerBlock
public long nbStripesPerBlock()
number of stripes per block
-
secretLimit
public long secretLimit()
size ofcustomSecretorextSecret
-
seed
public long seed()
seed for_withSeedvariants. Must be zero otherwise, seeXXH3_INITSTATE().
-
reserved64
public long reserved64()
reserved field
-
extSecret
public java.nio.ByteBuffer extSecret(int capacity)
- Parameters:
capacity- the number of elements in the returned buffer- Returns:
- reference to an external secret for the
_withSecretvariants,NULLfor other variants
-
malloc
public static XXH3State malloc()
Returns a newXXH3Stateinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XXH3State calloc()
Returns a newXXH3Stateinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XXH3State create()
Returns a newXXH3Stateinstance allocated withBufferUtils.
-
create
public static XXH3State create(long address)
Returns a newXXH3Stateinstance for the specified memory address.
-
createSafe
@Nullable public static XXH3State createSafe(long address)
-
malloc
public static XXH3State.Buffer malloc(int capacity)
Returns a newXXH3State.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XXH3State.Buffer calloc(int capacity)
Returns a newXXH3State.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XXH3State.Buffer create(int capacity)
Returns a newXXH3State.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XXH3State.Buffer create(long address, int capacity)
Create aXXH3State.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XXH3State.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static XXH3State mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static XXH3State callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static XXH3State mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static XXH3State callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static XXH3State.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static XXH3State.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static XXH3State.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static XXH3State.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static XXH3State malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXXH3Stateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XXH3State calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXXH3Stateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XXH3State.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XXH3State.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nacc
public static java.nio.LongBuffer nacc(long struct)
Unsafe version ofacc().
-
nacc
public static long nacc(long struct, int index)Unsafe version ofacc.
-
ncustomSecret
public static java.nio.ByteBuffer ncustomSecret(long struct)
Unsafe version ofcustomSecret().
-
ncustomSecret
public static byte ncustomSecret(long struct, int index)Unsafe version ofcustomSecret.
-
nbuffer
public static java.nio.ByteBuffer nbuffer(long struct)
Unsafe version ofbuffer().
-
nbuffer
public static byte nbuffer(long struct, int index)Unsafe version ofbuffer.
-
nbufferedSize
public static int nbufferedSize(long struct)
Unsafe version ofbufferedSize().
-
nuseSeed
public static int nuseSeed(long struct)
Unsafe version ofuseSeed().
-
nnbStripesSoFar
public static long nnbStripesSoFar(long struct)
Unsafe version ofnbStripesSoFar().
-
ntotalLen
public static long ntotalLen(long struct)
Unsafe version oftotalLen().
-
nnbStripesPerBlock
public static long nnbStripesPerBlock(long struct)
Unsafe version ofnbStripesPerBlock().
-
nsecretLimit
public static long nsecretLimit(long struct)
Unsafe version ofsecretLimit().
-
nseed
public static long nseed(long struct)
Unsafe version ofseed().
-
nreserved64
public static long nreserved64(long struct)
Unsafe version ofreserved64().
-
nextSecret
public static java.nio.ByteBuffer nextSecret(long struct, int capacity)Unsafe version ofextSecret.
-
-