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:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XXH3State
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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 ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct member offsets.static final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionXXH3State(ByteBuffer container) Creates aXXH3Stateinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionacc()the 8 accumulators.longacc(int index) the 8 accumulators.buffer()the internal buffer.bytebuffer(int index) the internal buffer.intthe 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 XXH3StateDeprecated.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) used to store a custom secret generated from a seedbytecustomSecret(int index) used to store a custom secret generated from a seedextSecret(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 XXH3StateDeprecated.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 LongBuffernacc(long struct) Unsafe version ofacc().static longnacc(long struct, int index) Unsafe version ofacc.longnumber of stripes per blocklongnumber or stripes processedstatic ByteBuffernbuffer(long struct) Unsafe version ofbuffer().static bytenbuffer(long struct, int index) Unsafe version ofbuffer.static intnbufferedSize(long struct) Unsafe version ofbufferedSize().static ByteBufferncustomSecret(long struct) Unsafe version ofcustomSecret().static bytencustomSecret(long struct, int index) Unsafe version ofcustomSecret.static 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().longreserved fieldlongsize ofcustomSecretorextSecretlongseed()seed for_withSeedvariants.intsizeof()longtotalLen()total length hashed.intuseSeed()reserved field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods 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 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
acc
the 8 accumulators. Similar tovinXXH32_state_sandXXH64_state_s. -
acc
public long acc(int index) the 8 accumulators. Similar tovinXXH32_state_sandXXH64_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 ofcustomSecretorextSecret -
seed
public long seed()seed for_withSeedvariants. 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
_withSecretvariants,NULLfor other variants
-
malloc
Returns a newXXH3Stateinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newXXH3Stateinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newXXH3Stateinstance allocated withBufferUtils. -
create
Returns a newXXH3Stateinstance for the specified memory address. -
createSafe
-
malloc
Returns a newXXH3State.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newXXH3State.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newXXH3State.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aXXH3State.Bufferinstance 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 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
Returns a newXXH3Stateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newXXH3Stateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newXXH3State.Bufferinstance allocated on the specifiedMemoryStackand 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.
-