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.Member documentation
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
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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classExtentHooks.BufferAn array ofExtentHooksstructs.
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor and 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 Modifier and Type Method and Description ExtentAllocalloc()Returns the value of theallocfield.ExtentHooksalloc(ExtentAllocI value)Sets the specified value to theallocfield.static ExtentHookscalloc()Returns a newExtentHooksinstance allocated withmemCalloc.static ExtentHooks.Buffercalloc(int capacity)Returns a newExtentHooks.Bufferinstance allocated withmemCalloc.static ExtentHookscallocStack()Returns a newExtentHooksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static ExtentHooks.BuffercallocStack(int capacity)Returns a newExtentHooks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static ExtentHooks.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newExtentHooks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static ExtentHookscallocStack(org.lwjgl.system.MemoryStack stack)Returns a newExtentHooksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.ExtentCommitcommit()Returns the value of thecommitfield.ExtentHookscommit(ExtentCommitI value)Sets the specified value to thecommitfield.static ExtentHookscreate()Returns a newExtentHooksinstance allocated withBufferUtils.static ExtentHooks.Buffercreate(int capacity)Returns a newExtentHooks.Bufferinstance allocated withBufferUtils.static ExtentHookscreate(long address)Returns a newExtentHooksinstance for the specified memory address.static ExtentHooks.Buffercreate(long address, int capacity)Create aExtentHooks.Bufferinstance at the specified memory.static ExtentHookscreateSafe(long address)static ExtentHooks.BuffercreateSafe(long address, int capacity)ExtentDallocdalloc()Returns the value of thedallocfield.ExtentHooksdalloc(ExtentDallocI value)Sets the specified value to thedallocfield.ExtentDecommitdecommit()Returns the value of thedecommitfield.ExtentHooksdecommit(ExtentDecommitI value)Sets the specified value to thedecommitfield.ExtentDestroydestroy()Returns the value of thedestroyfield.ExtentHooksdestroy(ExtentDestroyI value)Sets the specified value to thedestroyfield.static ExtentHooksmalloc()Returns a newExtentHooksinstance allocated withmemAlloc.static ExtentHooks.Buffermalloc(int capacity)Returns a newExtentHooks.Bufferinstance allocated withmemAlloc.static ExtentHooksmallocStack()Returns a newExtentHooksinstance allocated on the thread-localMemoryStack.static ExtentHooks.BuffermallocStack(int capacity)Returns a newExtentHooks.Bufferinstance allocated on the thread-localMemoryStack.static ExtentHooks.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newExtentHooks.Bufferinstance allocated on the specifiedMemoryStack.static ExtentHooksmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newExtentHooksinstance allocated on the specifiedMemoryStack.ExtentMergemerge()Returns the value of themergefield.ExtentHooksmerge(ExtentMergeI value)Sets the specified value to themergefield.ExtentPurgepurge_forced()Returns the value of thepurge_forcedfield.ExtentHookspurge_forced(ExtentPurgeI value)Sets the specified value to thepurge_forcedfield.ExtentPurgepurge_lazy()Returns the value of thepurge_lazyfield.ExtentHookspurge_lazy(ExtentPurgeI value)Sets the specified value to thepurge_lazyfield.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()Returns the value of thesplitfield.ExtentHookssplit(ExtentSplitI value)Sets the specified value to thesplitfield.static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)CallsExtentHooks.validate(long)for each struct contained in the specified struct array.
-
-
-
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()
Returns the value of theallocfield.
-
dalloc
@Nullable public ExtentDalloc dalloc()
Returns the value of thedallocfield.
-
destroy
@Nullable public ExtentDestroy destroy()
Returns the value of thedestroyfield.
-
commit
@Nullable public ExtentCommit commit()
Returns the value of thecommitfield.
-
decommit
@Nullable public ExtentDecommit decommit()
Returns the value of thedecommitfield.
-
purge_lazy
@Nullable public ExtentPurge purge_lazy()
Returns the value of thepurge_lazyfield.
-
purge_forced
@Nullable public ExtentPurge purge_forced()
Returns the value of thepurge_forcedfield.
-
split
@Nullable public ExtentSplit split()
Returns the value of thesplitfield.
-
merge
@Nullable public ExtentMerge merge()
Returns the value of themergefield.
-
alloc
public ExtentHooks alloc(ExtentAllocI value)
Sets the specified value to theallocfield.
-
dalloc
public ExtentHooks dalloc(@Nullable ExtentDallocI value)
Sets the specified value to thedallocfield.
-
destroy
public ExtentHooks destroy(@Nullable ExtentDestroyI value)
Sets the specified value to thedestroyfield.
-
commit
public ExtentHooks commit(@Nullable ExtentCommitI value)
Sets the specified value to thecommitfield.
-
decommit
public ExtentHooks decommit(@Nullable ExtentDecommitI value)
Sets the specified value to thedecommitfield.
-
purge_lazy
public ExtentHooks purge_lazy(@Nullable ExtentPurgeI value)
Sets the specified value to thepurge_lazyfield.
-
purge_forced
public ExtentHooks purge_forced(@Nullable ExtentPurgeI value)
Sets the specified value to thepurge_forcedfield.
-
split
public ExtentHooks split(@Nullable ExtentSplitI value)
Sets the specified value to thesplitfield.
-
merge
public ExtentHooks merge(@Nullable ExtentMergeI value)
Sets the specified value to themergefield.
-
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)
-
malloc
public static ExtentHooks.Buffer malloc(int capacity)
Returns a newExtentHooks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static ExtentHooks.Buffer calloc(int capacity)
Returns a newExtentHooks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static ExtentHooks.Buffer create(int capacity)
Returns a newExtentHooks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static ExtentHooks.Buffer create(long address, int capacity)
Create aExtentHooks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static ExtentHooks.Buffer createSafe(long address, int capacity)
-
mallocStack
public static ExtentHooks mallocStack()
Returns a newExtentHooksinstance allocated on the thread-localMemoryStack.
-
callocStack
public static ExtentHooks callocStack()
Returns a newExtentHooksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static ExtentHooks mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static ExtentHooks callocStack(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
-
mallocStack
public static ExtentHooks.Buffer mallocStack(int capacity)
Returns a newExtentHooks.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static ExtentHooks.Buffer callocStack(int capacity)
Returns a newExtentHooks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static ExtentHooks.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static ExtentHooks.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
validate
public static void validate(long array, int count)CallsExtentHooks.validate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-