Package org.lwjgl.system.jemalloc
Class ExtentHooks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.jemalloc.ExtentHooks
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class ExtentHooks extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceTheextent_hooks_tstructure 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 toNULL, or selectively opted out of by returning failure.Layout
struct extent_hooks_t {extent_alloc_talloc();extent_dalloc_tdalloc();extent_destroy_tdestroy();extent_commit_tcommit();extent_decommit_tdecommit();extent_purge_tpurge_lazy();extent_purge_tpurge_forced();extent_split_tsplit();extent_merge_tmerge(); }
-
-
Constructor Summary
Constructors Constructor Description ExtentHooks(java.nio.ByteBuffer container)Creates aExtentHooksinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ExtentAllocalloc()the extent allocation hookExtentHooksalloc(ExtentAllocI value)Sets the specified value to thealloc()field.static ExtentHookscalloc()Returns a newExtentHooksinstance allocated withmemCalloc.static ExtentHookscalloc(org.lwjgl.system.MemoryStack stack)Returns a newExtentHooksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ExtentHookscallocStack()Deprecated.static ExtentHookscallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.ExtentCommitcommit()the extent commit hookExtentHookscommit(ExtentCommitI value)Sets the specified value to thecommit()field.static ExtentHookscreate()Returns a newExtentHooksinstance allocated withBufferUtils.static ExtentHookscreate(long address)Returns a newExtentHooksinstance for the specified memory address.static ExtentHookscreateSafe(long address)ExtentDallocdalloc()the extent deallocation hookExtentHooksdalloc(ExtentDallocI value)Sets the specified value to thedalloc()field.ExtentDecommitdecommit()the extent decommit hookExtentHooksdecommit(ExtentDecommitI value)Sets the specified value to thedecommit()field.ExtentDestroydestroy()the extent destruction hookExtentHooksdestroy(ExtentDestroyI value)Sets the specified value to thedestroy()field.static ExtentHooksmalloc()Returns a newExtentHooksinstance allocated withmemAlloc.static ExtentHooksmalloc(org.lwjgl.system.MemoryStack stack)Returns a newExtentHooksinstance allocated on the specifiedMemoryStack.static ExtentHooksmallocStack()Deprecated.static ExtentHooksmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.ExtentMergemerge()the extent merge hookExtentHooksmerge(ExtentMergeI value)Sets the specified value to themerge()field.static ExtentAllocnalloc(long struct)Unsafe version ofalloc().static voidnalloc(long struct, ExtentAllocI value)Unsafe version ofalloc.static ExtentCommitncommit(long struct)Unsafe version ofcommit().static voidncommit(long struct, ExtentCommitI value)Unsafe version ofcommit.static ExtentDallocndalloc(long struct)Unsafe version ofdalloc().static voidndalloc(long struct, ExtentDallocI value)Unsafe version ofdalloc.static ExtentDecommitndecommit(long struct)Unsafe version ofdecommit().static voidndecommit(long struct, ExtentDecommitI value)Unsafe version ofdecommit.static ExtentDestroyndestroy(long struct)Unsafe version ofdestroy().static voidndestroy(long struct, ExtentDestroyI value)Unsafe version ofdestroy.static ExtentMergenmerge(long struct)Unsafe version ofmerge().static voidnmerge(long struct, ExtentMergeI value)Unsafe version ofmerge.static ExtentPurgenpurge_forced(long struct)Unsafe version ofpurge_forced().static voidnpurge_forced(long struct, ExtentPurgeI value)Unsafe version ofpurge_forced.static ExtentPurgenpurge_lazy(long struct)Unsafe version ofpurge_lazy().static voidnpurge_lazy(long struct, ExtentPurgeI value)Unsafe version ofpurge_lazy.static ExtentSplitnsplit(long struct)Unsafe version ofsplit().static voidnsplit(long struct, ExtentSplitI value)Unsafe version ofsplit.ExtentPurgepurge_forced()the extent forced purge hookExtentHookspurge_forced(ExtentPurgeI value)Sets the specified value to thepurge_forced()field.ExtentPurgepurge_lazy()the extent lazy purge hookExtentHookspurge_lazy(ExtentPurgeI value)Sets the specified value to thepurge_lazy()field.ExtentHooksset(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.ExtentHooksset(ExtentHooks src)Copies the specified struct data to this struct.intsizeof()ExtentSplitsplit()the extent split hookExtentHookssplit(ExtentSplitI value)Sets the specified value to thesplit()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
ExtentHooks
public ExtentHooks(java.nio.ByteBuffer container)
Creates aExtentHooksinstance 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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
alloc
public ExtentAlloc alloc()
the extent allocation hook
-
dalloc
@Nullable public ExtentDalloc dalloc()
the extent deallocation hook
-
destroy
@Nullable public ExtentDestroy destroy()
the extent destruction hook
-
commit
@Nullable public ExtentCommit commit()
the extent commit hook
-
decommit
@Nullable public ExtentDecommit decommit()
the extent decommit hook
-
purge_lazy
@Nullable public ExtentPurge purge_lazy()
the extent lazy purge hook
-
purge_forced
@Nullable public ExtentPurge purge_forced()
the extent forced purge hook
-
split
@Nullable public ExtentSplit split()
the extent split hook
-
merge
@Nullable public ExtentMerge merge()
the extent merge hook
-
alloc
public ExtentHooks alloc(ExtentAllocI value)
Sets the specified value to thealloc()field.
-
dalloc
public ExtentHooks dalloc(@Nullable ExtentDallocI value)
Sets the specified value to thedalloc()field.
-
destroy
public ExtentHooks destroy(@Nullable ExtentDestroyI value)
Sets the specified value to thedestroy()field.
-
commit
public ExtentHooks commit(@Nullable ExtentCommitI value)
Sets the specified value to thecommit()field.
-
decommit
public ExtentHooks decommit(@Nullable ExtentDecommitI value)
Sets the specified value to thedecommit()field.
-
purge_lazy
public ExtentHooks purge_lazy(@Nullable ExtentPurgeI value)
Sets the specified value to thepurge_lazy()field.
-
purge_forced
public ExtentHooks purge_forced(@Nullable ExtentPurgeI value)
Sets the specified value to thepurge_forced()field.
-
split
public ExtentHooks split(@Nullable ExtentSplitI value)
Sets the specified value to thesplit()field.
-
merge
public ExtentHooks merge(@Nullable ExtentMergeI value)
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
public ExtentHooks set(ExtentHooks src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static ExtentHooks malloc()
Returns a newExtentHooksinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static ExtentHooks calloc()
Returns a newExtentHooksinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static ExtentHooks create()
Returns a newExtentHooksinstance allocated withBufferUtils.
-
create
public static ExtentHooks create(long address)
Returns a newExtentHooksinstance for the specified memory address.
-
createSafe
@Nullable public static ExtentHooks createSafe(long address)
-
mallocStack
@Deprecated public static ExtentHooks mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static ExtentHooks callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static ExtentHooks mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static ExtentHooks callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
malloc
public static ExtentHooks malloc(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static ExtentHooks calloc(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
nalloc
public static ExtentAlloc nalloc(long struct)
Unsafe version ofalloc().
-
ndalloc
@Nullable public static ExtentDalloc ndalloc(long struct)
Unsafe version ofdalloc().
-
ndestroy
@Nullable public static ExtentDestroy ndestroy(long struct)
Unsafe version ofdestroy().
-
ncommit
@Nullable public static ExtentCommit ncommit(long struct)
Unsafe version ofcommit().
-
ndecommit
@Nullable public static ExtentDecommit ndecommit(long struct)
Unsafe version ofdecommit().
-
npurge_lazy
@Nullable public static ExtentPurge npurge_lazy(long struct)
Unsafe version ofpurge_lazy().
-
npurge_forced
@Nullable public static ExtentPurge npurge_forced(long struct)
Unsafe version ofpurge_forced().
-
nsplit
@Nullable public static ExtentSplit nsplit(long struct)
Unsafe version ofsplit().
-
nmerge
@Nullable public static ExtentMerge nmerge(long struct)
Unsafe version ofmerge().
-
nalloc
public static void nalloc(long struct, ExtentAllocI value)Unsafe version ofalloc.
-
ndalloc
public static void ndalloc(long struct, @Nullable ExtentDallocI value)Unsafe version ofdalloc.
-
ndestroy
public static void ndestroy(long struct, @Nullable ExtentDestroyI value)Unsafe version ofdestroy.
-
ncommit
public static void ncommit(long struct, @Nullable ExtentCommitI value)Unsafe version ofcommit.
-
ndecommit
public static void ndecommit(long struct, @Nullable ExtentDecommitI value)Unsafe version ofdecommit.
-
npurge_lazy
public static void npurge_lazy(long struct, @Nullable ExtentPurgeI value)Unsafe version ofpurge_lazy.
-
npurge_forced
public static void npurge_forced(long struct, @Nullable ExtentPurgeI value)Unsafe version ofpurge_forced.
-
nsplit
public static void nsplit(long struct, @Nullable ExtentSplitI value)Unsafe version ofsplit.
-
nmerge
public static void nmerge(long struct, @Nullable ExtentMergeI value)Unsafe version ofmerge.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-