Class mi_heap_area_t
- All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer
struct mi_heap_area_t {
void * blocks;
size_t reserved;
size_t committed;
size_t used;
size_t block_size;
size_t full_block_size;
void * reserved1;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Struct
Struct.StructValidationNested classes/interfaces inherited from interface Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 size in bytes.static final intThe struct member offsets.Fields inherited from interface Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionmi_heap_area_t(ByteBuffer container) Creates ami_heap_area_tinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionlongblock_size(long value) Sets the specified value to theblock_sizefield.longblocks()blocks(long value) Sets the specified value to theblocksfield.static mi_heap_area_tcalloc()Returns a newmi_heap_area_tinstance allocated withmemCalloc.static mi_heap_area_t.Buffercalloc(int capacity) Returns a newmi_heap_area_t.Bufferinstance allocated withmemCalloc.static mi_heap_area_t.Buffercalloc(int capacity, MemoryStack stack) Returns a newmi_heap_area_t.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static mi_heap_area_tcalloc(MemoryStack stack) Returns a newmi_heap_area_tinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.longcommitted(long value) Sets the specified value to thecommittedfield.static mi_heap_area_tcreate()Returns a newmi_heap_area_tinstance allocated withBufferUtils.static mi_heap_area_t.Buffercreate(int capacity) Returns a newmi_heap_area_t.Bufferinstance allocated withBufferUtils.static mi_heap_area_tcreate(long address) Returns a newmi_heap_area_tinstance for the specified memory address.static mi_heap_area_t.Buffercreate(long address, int capacity) Create ami_heap_area_t.Bufferinstance at the specified memory.static @Nullable mi_heap_area_tcreateSafe(long address) static @Nullable mi_heap_area_t.BuffercreateSafe(long address, int capacity) longfull_block_size(long value) Sets the specified value to thefull_block_sizefield.static mi_heap_area_tmalloc()Returns a newmi_heap_area_tinstance allocated withmemAlloc.static mi_heap_area_t.Buffermalloc(int capacity) Returns a newmi_heap_area_t.Bufferinstance allocated withmemAlloc.static mi_heap_area_t.Buffermalloc(int capacity, MemoryStack stack) Returns a newmi_heap_area_t.Bufferinstance allocated on the specifiedMemoryStack.static mi_heap_area_tmalloc(MemoryStack stack) Returns a newmi_heap_area_tinstance allocated on the specifiedMemoryStack.static longnblock_size(long struct) Unsafe version ofblock_size().static voidnblock_size(long struct, long value) Unsafe version ofblock_size.static longnblocks(long struct) Unsafe version ofblocks().static voidnblocks(long struct, long value) Unsafe version ofblocks.static longncommitted(long struct) Unsafe version ofcommitted().static voidncommitted(long struct, long value) Unsafe version ofcommitted.static longnfull_block_size(long struct) Unsafe version offull_block_size().static voidnfull_block_size(long struct, long value) Unsafe version offull_block_size.static longnreserved(long struct) Unsafe version ofreserved().static voidnreserved(long struct, long value) Unsafe version ofreserved.static longnused(long struct) Unsafe version ofused().static voidnused(long struct, long value) Unsafe version ofused.longreserved()reserved(long value) Sets the specified value to thereservedfield.set(long blocks, long reserved, long committed, long used, long block_size, long full_block_size) Initializes this struct with the specified values.set(mi_heap_area_t src) Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).longused()used(long value) Sets the specified value to theusedfield.static voidvalidate(long struct) Validates pointer members that should not beNULL.Methods inherited from class Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface 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. -
BLOCKS
public static final int BLOCKSThe struct member offsets. -
RESERVED
public static final int RESERVEDThe struct member offsets. -
COMMITTED
public static final int COMMITTEDThe struct member offsets. -
USED
public static final int USEDThe struct member offsets. -
BLOCK_SIZE
public static final int BLOCK_SIZEThe struct member offsets. -
FULL_BLOCK_SIZE
public static final int FULL_BLOCK_SIZEThe struct member offsets. -
RESERVED1
public static final int RESERVED1The struct member offsets.
-
-
Constructor Details
-
mi_heap_area_t
Creates ami_heap_area_tinstance 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()Description copied from class:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<mi_heap_area_t>
-
blocks
- Returns:
- the value of the
blocksfield.
-
reserved
- Returns:
- the value of the
reservedfield.
-
committed
- Returns:
- the value of the
committedfield.
-
used
- Returns:
- the value of the
usedfield.
-
block_size
- Returns:
- the value of the
block_sizefield.
-
full_block_size
- Returns:
- the value of the
full_block_sizefield.
-
blocks
Sets the specified value to theblocksfield. -
reserved
Sets the specified value to thereservedfield. -
committed
Sets the specified value to thecommittedfield. -
used
Sets the specified value to theusedfield. -
block_size
Sets the specified value to theblock_sizefield. -
full_block_size
Sets the specified value to thefull_block_sizefield. -
set
public mi_heap_area_t set(long blocks, long reserved, long committed, long used, long block_size, long full_block_size) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newmi_heap_area_tinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newmi_heap_area_tinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newmi_heap_area_tinstance allocated withBufferUtils. -
create
Returns a newmi_heap_area_tinstance for the specified memory address. -
createSafe
-
malloc
Returns a newmi_heap_area_t.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newmi_heap_area_t.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newmi_heap_area_t.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create ami_heap_area_t.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newmi_heap_area_tinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newmi_heap_area_tinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newmi_heap_area_t.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newmi_heap_area_t.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nblocks
public static long nblocks(long struct) Unsafe version ofblocks(). -
nreserved
public static long nreserved(long struct) Unsafe version ofreserved(). -
ncommitted
public static long ncommitted(long struct) Unsafe version ofcommitted(). -
nused
public static long nused(long struct) Unsafe version ofused(). -
nblock_size
public static long nblock_size(long struct) Unsafe version ofblock_size(). -
nfull_block_size
public static long nfull_block_size(long struct) Unsafe version offull_block_size(). -
nblocks
public static void nblocks(long struct, long value) Unsafe version ofblocks. -
nreserved
public static void nreserved(long struct, long value) Unsafe version ofreserved. -
ncommitted
public static void ncommitted(long struct, long value) Unsafe version ofcommitted. -
nused
public static void nused(long struct, long value) Unsafe version ofused. -
nblock_size
public static void nblock_size(long struct, long value) Unsafe version ofblock_size. -
nfull_block_size
public static void nfull_block_size(long struct, long value) Unsafe version offull_block_size. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-