public class ExtentHooks
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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.
alloc – the extent allocation hookdalloc – the extent deallocation hookdestroy – the extent destruction hookcommit – the extent commit hookdecommit – the extent decommit hookpurge_lazy – the extent lazy purge hookpurge_forced – the extent forced purge hooksplit – the extent split hookmerge – the extent merge hook
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;
}| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ALLOC
The struct member offsets.
|
static int |
COMMIT
The struct member offsets.
|
static int |
DALLOC
The struct member offsets.
|
static int |
DECOMMIT
The struct member offsets.
|
static int |
DESTROY
The struct member offsets.
|
static int |
MERGE
The struct member offsets.
|
static int |
PURGE_FORCED
The struct member offsets.
|
static int |
PURGE_LAZY
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
SPLIT
The struct member offsets.
|
| Constructor and Description |
|---|
ExtentHooks(java.nio.ByteBuffer container)
Creates a
ExtentHooks instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
ExtentAlloc |
alloc()
Returns the value of the
alloc field. |
ExtentHooks |
alloc(ExtentAllocI value)
Sets the specified value to the
alloc field. |
static ExtentHooks |
calloc()
Returns a new
ExtentHooks instance allocated with memCalloc. |
static ExtentHooks |
callocStack()
Returns a new
ExtentHooks instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static ExtentHooks |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
ExtentHooks instance allocated on the specified MemoryStack and initializes all its bits to zero. |
ExtentCommit |
commit()
Returns the value of the
commit field. |
ExtentHooks |
commit(ExtentCommitI value)
Sets the specified value to the
commit field. |
static ExtentHooks |
create()
Returns a new
ExtentHooks instance allocated with BufferUtils. |
static ExtentHooks |
create(long address)
Returns a new
ExtentHooks instance for the specified memory address. |
static ExtentHooks |
createSafe(long address)
|
ExtentDalloc |
dalloc()
Returns the value of the
dalloc field. |
ExtentHooks |
dalloc(ExtentDallocI value)
Sets the specified value to the
dalloc field. |
ExtentDecommit |
decommit()
Returns the value of the
decommit field. |
ExtentHooks |
decommit(ExtentDecommitI value)
Sets the specified value to the
decommit field. |
ExtentDestroy |
destroy()
Returns the value of the
destroy field. |
ExtentHooks |
destroy(ExtentDestroyI value)
Sets the specified value to the
destroy field. |
static ExtentHooks |
malloc()
Returns a new
ExtentHooks instance allocated with memAlloc. |
static ExtentHooks |
mallocStack()
Returns a new
ExtentHooks instance allocated on the thread-local MemoryStack. |
static ExtentHooks |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
ExtentHooks instance allocated on the specified MemoryStack. |
ExtentMerge |
merge()
Returns the value of the
merge field. |
ExtentHooks |
merge(ExtentMergeI value)
Sets the specified value to the
merge field. |
static ExtentAlloc |
nalloc(long struct)
Unsafe version of
alloc(). |
static void |
nalloc(long struct,
ExtentAllocI value)
Unsafe version of
alloc. |
static ExtentCommit |
ncommit(long struct)
Unsafe version of
commit(). |
static void |
ncommit(long struct,
ExtentCommitI value)
Unsafe version of
commit. |
static ExtentDalloc |
ndalloc(long struct)
Unsafe version of
dalloc(). |
static void |
ndalloc(long struct,
ExtentDallocI value)
Unsafe version of
dalloc. |
static ExtentDecommit |
ndecommit(long struct)
Unsafe version of
decommit(). |
static void |
ndecommit(long struct,
ExtentDecommitI value)
Unsafe version of
decommit. |
static ExtentDestroy |
ndestroy(long struct)
Unsafe version of
destroy(). |
static void |
ndestroy(long struct,
ExtentDestroyI value)
Unsafe version of
destroy. |
static ExtentMerge |
nmerge(long struct)
Unsafe version of
merge(). |
static void |
nmerge(long struct,
ExtentMergeI value)
Unsafe version of
merge. |
static ExtentPurge |
npurge_forced(long struct)
Unsafe version of
purge_forced(). |
static void |
npurge_forced(long struct,
ExtentPurgeI value)
Unsafe version of
purge_forced. |
static ExtentPurge |
npurge_lazy(long struct)
Unsafe version of
purge_lazy(). |
static void |
npurge_lazy(long struct,
ExtentPurgeI value)
Unsafe version of
purge_lazy. |
static ExtentSplit |
nsplit(long struct)
Unsafe version of
split(). |
static void |
nsplit(long struct,
ExtentSplitI value)
Unsafe version of
split. |
ExtentPurge |
purge_forced()
Returns the value of the
purge_forced field. |
ExtentHooks |
purge_forced(ExtentPurgeI value)
Sets the specified value to the
purge_forced field. |
ExtentPurge |
purge_lazy()
Returns the value of the
purge_lazy field. |
ExtentHooks |
purge_lazy(ExtentPurgeI value)
Sets the specified value to the
purge_lazy field. |
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.
|
ExtentHooks |
set(ExtentHooks src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
ExtentSplit |
split()
Returns the value of the
split field. |
ExtentHooks |
split(ExtentSplitI value)
Sets the specified value to the
split field. |
static void |
validate(long struct)
Validates pointer members that should not be
NULL. |
static void |
validate(long array,
int count)
Calls
validate(long) for each struct contained in the specified struct array. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int ALLOC
public static final int DALLOC
public static final int DESTROY
public static final int COMMIT
public static final int DECOMMIT
public static final int PURGE_LAZY
public static final int PURGE_FORCED
public static final int SPLIT
public static final int MERGE
public ExtentHooks(java.nio.ByteBuffer container)
ExtentHooks instance at the current position of the specified ByteBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic ExtentAlloc alloc()
alloc field.@Nullable public ExtentDalloc dalloc()
dalloc field.@Nullable public ExtentDestroy destroy()
destroy field.@Nullable public ExtentCommit commit()
commit field.@Nullable public ExtentDecommit decommit()
decommit field.@Nullable public ExtentPurge purge_lazy()
purge_lazy field.@Nullable public ExtentPurge purge_forced()
purge_forced field.@Nullable public ExtentSplit split()
split field.@Nullable public ExtentMerge merge()
merge field.public ExtentHooks alloc(ExtentAllocI value)
alloc field.public ExtentHooks dalloc(@Nullable ExtentDallocI value)
dalloc field.public ExtentHooks destroy(@Nullable ExtentDestroyI value)
destroy field.public ExtentHooks commit(@Nullable ExtentCommitI value)
commit field.public ExtentHooks decommit(@Nullable ExtentDecommitI value)
decommit field.public ExtentHooks purge_lazy(@Nullable ExtentPurgeI value)
purge_lazy field.public ExtentHooks purge_forced(@Nullable ExtentPurgeI value)
purge_forced field.public ExtentHooks split(@Nullable ExtentSplitI value)
split field.public ExtentHooks merge(@Nullable ExtentMergeI value)
merge field.public ExtentHooks set(ExtentAllocI alloc, ExtentDallocI dalloc, ExtentDestroyI destroy, ExtentCommitI commit, ExtentDecommitI decommit, ExtentPurgeI purge_lazy, ExtentPurgeI purge_forced, ExtentSplitI split, ExtentMergeI merge)
public ExtentHooks set(ExtentHooks src)
src - the source structpublic static ExtentHooks malloc()
ExtentHooks instance allocated with memAlloc. The instance must be explicitly freed.public static ExtentHooks calloc()
ExtentHooks instance allocated with memCalloc. The instance must be explicitly freed.public static ExtentHooks create()
ExtentHooks instance allocated with BufferUtils.public static ExtentHooks create(long address)
ExtentHooks instance for the specified memory address.@Nullable public static ExtentHooks createSafe(long address)
public static ExtentHooks mallocStack()
ExtentHooks instance allocated on the thread-local MemoryStack.public static ExtentHooks callocStack()
ExtentHooks instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static ExtentHooks mallocStack(org.lwjgl.system.MemoryStack stack)
ExtentHooks instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static ExtentHooks callocStack(org.lwjgl.system.MemoryStack stack)
ExtentHooks instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static ExtentAlloc nalloc(long struct)
alloc().@Nullable public static ExtentDalloc ndalloc(long struct)
dalloc().@Nullable public static ExtentDestroy ndestroy(long struct)
destroy().@Nullable public static ExtentCommit ncommit(long struct)
commit().@Nullable public static ExtentDecommit ndecommit(long struct)
decommit().@Nullable public static ExtentPurge npurge_lazy(long struct)
purge_lazy().@Nullable public static ExtentPurge npurge_forced(long struct)
purge_forced().@Nullable public static ExtentSplit nsplit(long struct)
split().@Nullable public static ExtentMerge nmerge(long struct)
merge().public static void nalloc(long struct,
ExtentAllocI value)
alloc.public static void ndalloc(long struct,
@Nullable
ExtentDallocI value)
dalloc.public static void ndestroy(long struct,
@Nullable
ExtentDestroyI value)
destroy.public static void ncommit(long struct,
@Nullable
ExtentCommitI value)
commit.public static void ndecommit(long struct,
@Nullable
ExtentDecommitI value)
decommit.public static void npurge_lazy(long struct,
@Nullable
ExtentPurgeI value)
purge_lazy.public static void npurge_forced(long struct,
@Nullable
ExtentPurgeI value)
purge_forced.public static void nsplit(long struct,
@Nullable
ExtentSplitI value)
split.public static void nmerge(long struct,
@Nullable
ExtentMergeI value)
merge.public static void validate(long struct)
NULL.struct - the struct to validatepublic static void validate(long array,
int count)
validate(long) for each struct contained in the specified struct array.array - the struct array to validatecount - the number of structs in arrayCopyright LWJGL. All Rights Reserved. License terms.