Class ecs_allocator_t
java.lang.Object
com.github.elebras1.flecs.ecs_allocator_t
struct ecs_allocator_t {
ecs_block_allocator_t chunks;
struct ecs_sparse_t sizes;
}
-
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 MemorySegmentchunks(MemorySegment struct) Getter for field:ecs_block_allocator_t chunksstatic voidchunks(MemorySegment struct, MemorySegment fieldValue) Setter for field:ecs_block_allocator_t chunksstatic final GroupLayoutLayout for field:ecs_block_allocator_t chunksstatic final longOffset for field:ecs_block_allocator_t chunksstatic 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 structstatic MemorySegmentsizes(MemorySegment struct) Getter for field:struct ecs_sparse_t sizesstatic voidsizes(MemorySegment struct, MemorySegment fieldValue) Setter for field:struct ecs_sparse_t sizesstatic final GroupLayoutLayout for field:struct ecs_sparse_t sizesstatic final longOffset for field:struct ecs_sparse_t sizes
-
Method Details
-
layout
The layout of this struct -
chunks$layout
Layout for field:ecs_block_allocator_t chunks -
chunks$offset
public static final long chunks$offset()Offset for field:ecs_block_allocator_t chunks -
chunks
Getter for field:ecs_block_allocator_t chunks -
chunks
Setter for field:ecs_block_allocator_t chunks -
sizes$layout
Layout for field:struct ecs_sparse_t sizes -
sizes$offset
public static final long sizes$offset()Offset for field:struct ecs_sparse_t sizes -
sizes
Getter for field:struct ecs_sparse_t sizes -
sizes
Setter for field:struct ecs_sparse_t sizes -
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()
-