Class ecs_block_allocator_t
java.lang.Object
com.github.elebras1.flecs.ecs_block_allocator_t
struct ecs_block_allocator_t {
int32_t data_size;
int32_t chunk_size;
int32_t chunks_per_block;
int32_t block_size;
ecs_block_allocator_chunk_header_t *head;
ecs_block_allocator_block_t *block_head;
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegmentallocate(SegmentAllocator allocator) Allocate a segment of sizelayout().byteSize()usingallocatorstatic MemorySegmentallocateArray(long elementCount, SegmentAllocator allocator) Allocate an array of sizeelementCountusingallocator.static MemorySegmentasSlice(MemorySegment array, long index) Obtains a slice ofarrayParamwhich selects the array element atindex.static MemorySegmentblock_head(MemorySegment struct) Getter for field:ecs_block_allocator_block_t *block_headstatic voidblock_head(MemorySegment struct, MemorySegment fieldValue) Setter for field:ecs_block_allocator_block_t *block_headstatic final AddressLayoutLayout for field:ecs_block_allocator_block_t *block_headstatic final longOffset for field:ecs_block_allocator_block_t *block_headstatic intblock_size(MemorySegment struct) Getter for field:int32_t block_sizestatic voidblock_size(MemorySegment struct, int fieldValue) Setter for field:int32_t block_sizestatic final ValueLayout.OfIntLayout for field:int32_t block_sizestatic final longOffset for field:int32_t block_sizestatic intchunk_size(MemorySegment struct) Getter for field:int32_t chunk_sizestatic voidchunk_size(MemorySegment struct, int fieldValue) Setter for field:int32_t chunk_sizestatic final ValueLayout.OfIntLayout for field:int32_t chunk_sizestatic final longOffset for field:int32_t chunk_sizestatic intchunks_per_block(MemorySegment struct) Getter for field:int32_t chunks_per_blockstatic voidchunks_per_block(MemorySegment struct, int fieldValue) Setter for field:int32_t chunks_per_blockstatic final ValueLayout.OfIntLayout for field:int32_t chunks_per_blockstatic final longOffset for field:int32_t chunks_per_blockstatic intdata_size(MemorySegment struct) Getter for field:int32_t data_sizestatic voiddata_size(MemorySegment struct, int fieldValue) Setter for field:int32_t data_sizestatic final ValueLayout.OfIntLayout for field:int32_t data_sizestatic final longOffset for field:int32_t data_sizestatic MemorySegmenthead(MemorySegment struct) Getter for field:ecs_block_allocator_chunk_header_t *headstatic voidhead(MemorySegment struct, MemorySegment fieldValue) Setter for field:ecs_block_allocator_chunk_header_t *headstatic final AddressLayoutLayout for field:ecs_block_allocator_chunk_header_t *headstatic final longOffset for field:ecs_block_allocator_chunk_header_t *headstatic final GroupLayoutlayout()The layout of this structstatic MemorySegmentreinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static MemorySegmentreinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static longsizeof()The size (in bytes) of this struct
-
Method Details
-
layout
The layout of this struct -
data_size$layout
Layout for field:int32_t data_size -
data_size$offset
public static final long data_size$offset()Offset for field:int32_t data_size -
data_size
Getter for field:int32_t data_size -
data_size
Setter for field:int32_t data_size -
chunk_size$layout
Layout for field:int32_t chunk_size -
chunk_size$offset
public static final long chunk_size$offset()Offset for field:int32_t chunk_size -
chunk_size
Getter for field:int32_t chunk_size -
chunk_size
Setter for field:int32_t chunk_size -
chunks_per_block$layout
Layout for field:int32_t chunks_per_block -
chunks_per_block$offset
public static final long chunks_per_block$offset()Offset for field:int32_t chunks_per_block -
chunks_per_block
Getter for field:int32_t chunks_per_block -
chunks_per_block
Setter for field:int32_t chunks_per_block -
block_size$layout
Layout for field:int32_t block_size -
block_size$offset
public static final long block_size$offset()Offset for field:int32_t block_size -
block_size
Getter for field:int32_t block_size -
block_size
Setter for field:int32_t block_size -
head$layout
Layout for field:ecs_block_allocator_chunk_header_t *head -
head$offset
public static final long head$offset()Offset for field:ecs_block_allocator_chunk_header_t *head -
head
Getter for field:ecs_block_allocator_chunk_header_t *head -
head
Setter for field:ecs_block_allocator_chunk_header_t *head -
block_head$layout
Layout for field:ecs_block_allocator_block_t *block_head -
block_head$offset
public static final long block_head$offset()Offset for field:ecs_block_allocator_block_t *block_head -
block_head
Getter for field:ecs_block_allocator_block_t *block_head -
block_head
Setter for field:ecs_block_allocator_block_t *block_head -
asSlice
Obtains a slice ofarrayParamwhich selects the array element atindex. The returned segment has addressarrayParam.address() + index * layout().byteSize() -
sizeof
public static long sizeof()The size (in bytes) of this struct -
allocate
Allocate a segment of sizelayout().byteSize()usingallocator -
allocateArray
Allocate an array of sizeelementCountusingallocator. The returned segment has sizeelementCount * layout().byteSize(). -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizelayout().byteSize() -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizeelementCount * layout().byteSize()
-