Package org.lwjgl.system.jemalloc
Class ExtentHooks
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<ExtentHooks>
org.lwjgl.system.jemalloc.ExtentHooks
- All Implemented Interfaces:
AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class ExtentHooks
extends org.lwjgl.system.Struct<ExtentHooks>
implements org.lwjgl.system.NativeResource
The
extent_hooks_t
structure comprises function pointers which are described individually below. jemalloc uses these functions to manage extent
lifetime, which starts off with allocation of mapped committed memory, in the simplest case followed by deallocation. However, there are performance
and platform reasons to retain extents for later reuse. Cleanup attempts cascade from deallocation to decommit to forced purging to lazy purging, which
gives the extent management functions opportunities to reject the most permanent cleanup operations in favor of less permanent (and often less costly)
operations. All operations except allocation can be universally opted out of by setting the hook pointers to NULL
, or selectively opted out of by
returning failure.
Layout
struct extent_hooks_t {
extent_alloc_t
alloc()
;
extent_dalloc_t
dalloc()
;
extent_destroy_t
destroy()
;
extent_commit_t
commit()
;
extent_decommit_t
decommit()
;
extent_purge_t
purge_lazy()
;
extent_purge_t
purge_forced()
;
extent_split_t
split()
;
extent_merge_t
merge()
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 size in bytes.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
ConstructorsConstructorDescriptionExtentHooks
(ByteBuffer container) Creates aExtentHooks
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionalloc()
the extent allocation hookalloc
(ExtentAllocI value) Sets the specified value to thealloc()
field.static ExtentHooks
calloc()
Returns a newExtentHooks
instance allocated withmemCalloc
.static ExtentHooks
calloc
(org.lwjgl.system.MemoryStack stack) Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static ExtentHooks
Deprecated.static ExtentHooks
callocStack
(org.lwjgl.system.MemoryStack stack) Deprecated.commit()
the extent commit hookcommit
(ExtentCommitI value) Sets the specified value to thecommit()
field.static ExtentHooks
create()
Returns a newExtentHooks
instance allocated withBufferUtils
.static ExtentHooks
create
(long address) Returns a newExtentHooks
instance for the specified memory address.static ExtentHooks
createSafe
(long address) dalloc()
the extent deallocation hookdalloc
(ExtentDallocI value) Sets the specified value to thedalloc()
field.decommit()
the extent decommit hookdecommit
(ExtentDecommitI value) Sets the specified value to thedecommit()
field.destroy()
the extent destruction hookdestroy
(ExtentDestroyI value) Sets the specified value to thedestroy()
field.static ExtentHooks
malloc()
Returns a newExtentHooks
instance allocated withmemAlloc
.static ExtentHooks
malloc
(org.lwjgl.system.MemoryStack stack) Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
.static ExtentHooks
Deprecated.static ExtentHooks
mallocStack
(org.lwjgl.system.MemoryStack stack) Deprecated.merge()
the extent merge hookmerge
(ExtentMergeI value) Sets the specified value to themerge()
field.static ExtentAlloc
nalloc
(long struct) Unsafe version ofalloc()
.static void
nalloc
(long struct, ExtentAllocI value) Unsafe version ofalloc
.static ExtentCommit
ncommit
(long struct) Unsafe version ofcommit()
.static void
ncommit
(long struct, ExtentCommitI value) Unsafe version ofcommit
.static ExtentDalloc
ndalloc
(long struct) Unsafe version ofdalloc()
.static void
ndalloc
(long struct, ExtentDallocI value) Unsafe version ofdalloc
.static ExtentDecommit
ndecommit
(long struct) Unsafe version ofdecommit()
.static void
ndecommit
(long struct, ExtentDecommitI value) Unsafe version ofdecommit
.static ExtentDestroy
ndestroy
(long struct) Unsafe version ofdestroy()
.static void
ndestroy
(long struct, ExtentDestroyI value) Unsafe version ofdestroy
.static ExtentMerge
nmerge
(long struct) Unsafe version ofmerge()
.static void
nmerge
(long struct, ExtentMergeI value) Unsafe version ofmerge
.static ExtentPurge
npurge_forced
(long struct) Unsafe version ofpurge_forced()
.static void
npurge_forced
(long struct, ExtentPurgeI value) Unsafe version ofpurge_forced
.static ExtentPurge
npurge_lazy
(long struct) Unsafe version ofpurge_lazy()
.static void
npurge_lazy
(long struct, ExtentPurgeI value) Unsafe version ofpurge_lazy
.static ExtentSplit
nsplit
(long struct) Unsafe version ofsplit()
.static void
nsplit
(long struct, ExtentSplitI value) Unsafe version ofsplit
.the extent forced purge hookpurge_forced
(ExtentPurgeI value) Sets the specified value to thepurge_forced()
field.the extent lazy purge hookpurge_lazy
(ExtentPurgeI value) Sets the specified value to thepurge_lazy()
field.set
(ExtentAllocI alloc, ExtentDallocI dalloc, ExtentDestroyI destroy, ExtentCommitI commit, ExtentDecommitI decommit, ExtentPurgeI purge_lazy, ExtentPurgeI purge_forced, ExtentSplitI split, ExtentMergeI merge) Initializes this struct with the specified values.set
(ExtentHooks src) Copies the specified struct data to this struct.int
sizeof()
split()
the extent split hooksplit
(ExtentSplitI value) Sets the specified value to thesplit()
field.static void
validate
(long struct) Validates pointer members that should not beNULL
.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate
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. -
ALLOC
public static final int ALLOCThe struct member offsets. -
DALLOC
public static final int DALLOCThe struct member offsets. -
DESTROY
public static final int DESTROYThe struct member offsets. -
COMMIT
public static final int COMMITThe struct member offsets. -
DECOMMIT
public static final int DECOMMITThe struct member offsets. -
PURGE_LAZY
public static final int PURGE_LAZYThe struct member offsets. -
PURGE_FORCED
public static final int PURGE_FORCEDThe struct member offsets. -
SPLIT
public static final int SPLITThe struct member offsets. -
MERGE
public static final int MERGEThe struct member offsets.
-
-
Constructor Details
-
ExtentHooks
Creates aExtentHooks
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()- Specified by:
sizeof
in classorg.lwjgl.system.Struct<ExtentHooks>
-
alloc
the extent allocation hook -
dalloc
the extent deallocation hook -
destroy
the extent destruction hook -
commit
the extent commit hook -
decommit
the extent decommit hook -
purge_lazy
the extent lazy purge hook -
purge_forced
the extent forced purge hook -
split
the extent split hook -
merge
the extent merge hook -
alloc
Sets the specified value to thealloc()
field. -
dalloc
Sets the specified value to thedalloc()
field. -
destroy
Sets the specified value to thedestroy()
field. -
commit
Sets the specified value to thecommit()
field. -
decommit
Sets the specified value to thedecommit()
field. -
purge_lazy
Sets the specified value to thepurge_lazy()
field. -
purge_forced
Sets the specified value to thepurge_forced()
field. -
split
Sets the specified value to thesplit()
field. -
merge
Sets the specified value to themerge()
field. -
set
public ExtentHooks set(ExtentAllocI alloc, ExtentDallocI dalloc, ExtentDestroyI destroy, ExtentCommitI commit, ExtentDecommitI decommit, ExtentPurgeI purge_lazy, ExtentPurgeI purge_forced, ExtentSplitI split, ExtentMergeI merge) 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 newExtentHooks
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newExtentHooks
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newExtentHooks
instance allocated withBufferUtils
. -
create
Returns a newExtentHooks
instance for the specified memory address. -
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. -
malloc
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
nalloc
Unsafe version ofalloc()
. -
ndalloc
Unsafe version ofdalloc()
. -
ndestroy
Unsafe version ofdestroy()
. -
ncommit
Unsafe version ofcommit()
. -
ndecommit
Unsafe version ofdecommit()
. -
npurge_lazy
Unsafe version ofpurge_lazy()
. -
npurge_forced
Unsafe version ofpurge_forced()
. -
nsplit
Unsafe version ofsplit()
. -
nmerge
Unsafe version ofmerge()
. -
nalloc
Unsafe version ofalloc
. -
ndalloc
Unsafe version ofdalloc
. -
ndestroy
Unsafe version ofdestroy
. -
ncommit
Unsafe version ofcommit
. -
ndecommit
Unsafe version ofdecommit
. -
npurge_lazy
Unsafe version ofpurge_lazy
. -
npurge_forced
Unsafe version ofpurge_forced
. -
nsplit
Unsafe version ofsplit
. -
nmerge
Unsafe version ofmerge
. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-