Package org.lwjgl.util.xxhash
Class XXH3State
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
The 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. Use
XXHash.XXH3_createState()
and XXHash.XXH3_freeState(org.lwjgl.util.xxhash.XXH3State)
, or stack allocation.
Layout
struct XXH3_state_t {
XXH64_hash_t acc()
[8];
unsigned char customSecret()
[XXH3_SECRET_DEFAULT_SIZE];
char[64 - (XXH3_SECRET_DEFAULT_SIZE & 63)];
unsigned char buffer()
[256];
XXH32_hash_t bufferedSize()
;
XXH32_hash_t useSeed()
;
size_t nbStripesSoFar()
;
XXH64_hash_t totalLen()
;
size_t nbStripesPerBlock()
;
size_t secretLimit()
;
XXH64_hash_t seed()
;
XXH64_hash_t reserved64()
;
unsigned char const * extSecret(int)
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct member offsets.static final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionXXH3State
(ByteBuffer container) Creates aXXH3State
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionacc()
the 8 accumulators.long
acc
(int index) the 8 accumulators.buffer()
the internal buffer.byte
buffer
(int index) the internal buffer.int
the amount of memory inbuffer
, SeeXXH32_state_s::memsize
.static XXH3State
calloc()
Returns a newXXH3State
instance allocated withmemCalloc
.static XXH3State.Buffer
calloc
(int capacity) Returns a newXXH3State.Buffer
instance allocated withmemCalloc
.static XXH3State.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newXXH3State.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static XXH3State
calloc
(MemoryStack stack) Returns a newXXH3State
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static XXH3State
Deprecated.static XXH3State.Buffer
callocStack
(int capacity) Deprecated.static XXH3State.Buffer
callocStack
(int capacity, MemoryStack stack) Deprecated.static XXH3State
callocStack
(MemoryStack stack) Deprecated.static XXH3State
create()
Returns a newXXH3State
instance allocated withBufferUtils
.static XXH3State.Buffer
create
(int capacity) Returns a newXXH3State.Buffer
instance allocated withBufferUtils
.static XXH3State
create
(long address) Returns a newXXH3State
instance for the specified memory address.static XXH3State.Buffer
create
(long address, int capacity) Create aXXH3State.Buffer
instance at the specified memory.static XXH3State
createSafe
(long address) static XXH3State.Buffer
createSafe
(long address, int capacity) used to store a custom secret generated from a seedbyte
customSecret
(int index) used to store a custom secret generated from a seedextSecret
(int capacity) static XXH3State
malloc()
Returns a newXXH3State
instance allocated withmemAlloc
.static XXH3State.Buffer
malloc
(int capacity) Returns a newXXH3State.Buffer
instance allocated withmemAlloc
.static XXH3State.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newXXH3State.Buffer
instance allocated on the specifiedMemoryStack
.static XXH3State
malloc
(MemoryStack stack) Returns a newXXH3State
instance allocated on the specifiedMemoryStack
.static XXH3State
Deprecated.static XXH3State.Buffer
mallocStack
(int capacity) Deprecated.static XXH3State.Buffer
mallocStack
(int capacity, MemoryStack stack) Deprecated.static XXH3State
mallocStack
(MemoryStack stack) Deprecated.static LongBuffer
nacc
(long struct) Unsafe version ofacc()
.static long
nacc
(long struct, int index) Unsafe version ofacc
.long
number of stripes per blocklong
number or stripes processedstatic ByteBuffer
nbuffer
(long struct) Unsafe version ofbuffer()
.static byte
nbuffer
(long struct, int index) Unsafe version ofbuffer
.static int
nbufferedSize
(long struct) Unsafe version ofbufferedSize()
.static ByteBuffer
ncustomSecret
(long struct) Unsafe version ofcustomSecret()
.static byte
ncustomSecret
(long struct, int index) Unsafe version ofcustomSecret
.static ByteBuffer
nextSecret
(long struct, int capacity) Unsafe version ofextSecret
.static long
nnbStripesPerBlock
(long struct) Unsafe version ofnbStripesPerBlock()
.static long
nnbStripesSoFar
(long struct) Unsafe version ofnbStripesSoFar()
.static long
nreserved64
(long struct) Unsafe version ofreserved64()
.static long
nsecretLimit
(long struct) Unsafe version ofsecretLimit()
.static long
nseed
(long struct) Unsafe version ofseed()
.static long
ntotalLen
(long struct) Unsafe version oftotalLen()
.static int
nuseSeed
(long struct) Unsafe version ofuseSeed()
.long
reserved fieldlong
size ofcustomSecret
orextSecret
long
seed()
seed for_withSeed
variants.int
sizeof()
Returnssizeof(struct)
.long
totalLen()
total length hashed.int
useSeed()
reserved field.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
ACC
public static final int ACCThe struct member offsets. -
CUSTOMSECRET
public static final int CUSTOMSECRETThe struct member offsets. -
BUFFER
public static final int BUFFERThe struct member offsets. -
BUFFEREDSIZE
public static final int BUFFEREDSIZEThe struct member offsets. -
USESEED
public static final int USESEEDThe struct member offsets. -
NBSTRIPESSOFAR
public static final int NBSTRIPESSOFARThe struct member offsets. -
TOTALLEN
public static final int TOTALLENThe struct member offsets. -
NBSTRIPESPERBLOCK
public static final int NBSTRIPESPERBLOCKThe struct member offsets. -
SECRETLIMIT
public static final int SECRETLIMITThe struct member offsets. -
SEED
public static final int SEEDThe struct member offsets. -
RESERVED64
public static final int RESERVED64The struct member offsets. -
EXTSECRET
public static final int EXTSECRETThe struct member offsets.
-
-
Constructor Details
-
XXH3State
Creates aXXH3State
instance at the current position of the specifiedByteBuffer
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
. -
acc
the 8 accumulators. Similar tov
inXXH32_state_s
andXXH64_state_s
. -
acc
public long acc(int index) the 8 accumulators. Similar tov
inXXH32_state_s
andXXH64_state_s
. -
customSecret
used to store a custom secret generated from a seed -
customSecret
public byte customSecret(int index) used to store a custom secret generated from a seed -
buffer
the internal buffer. SeeXXH32_state_s::mem32
. -
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 ofcustomSecret
orextSecret
-
seed
public long seed()seed for_withSeed
variants. Must be zero otherwise, seeXXH3_INITSTATE()
. -
reserved64
public long reserved64()reserved field -
extSecret
- Parameters:
capacity
- the number of elements in the returned buffer- Returns:
- reference to an external secret for the
_withSecret
variants,NULL
for other variants
-
malloc
Returns a newXXH3State
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newXXH3State
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newXXH3State
instance allocated withBufferUtils
. -
create
Returns a newXXH3State
instance for the specified memory address. -
createSafe
-
malloc
Returns a newXXH3State.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newXXH3State.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newXXH3State.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aXXH3State.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newXXH3State
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newXXH3State
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newXXH3State.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newXXH3State.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nacc
Unsafe version ofacc()
. -
nacc
public static long nacc(long struct, int index) Unsafe version ofacc
. -
ncustomSecret
Unsafe version ofcustomSecret()
. -
ncustomSecret
public static byte ncustomSecret(long struct, int index) Unsafe version ofcustomSecret
. -
nbuffer
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
Unsafe version ofextSecret
.
-