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.NativeResource
Theextent_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 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_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; }
-
-
Constructor Summary
Constructors Constructor Description ExtentHooks(java.nio.ByteBuffer container)
Creates aExtentHooks
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtentAlloc
alloc()
Returns the value of thealloc
field.ExtentHooks
alloc(ExtentAllocI value)
Sets the specified value to thealloc
field.static ExtentHooks
calloc()
Returns a newExtentHooks
instance allocated withmemCalloc
.static ExtentHooks
callocStack()
Returns a newExtentHooks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static ExtentHooks
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.ExtentCommit
commit()
Returns the value of thecommit
field.ExtentHooks
commit(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)
ExtentDalloc
dalloc()
Returns the value of thedalloc
field.ExtentHooks
dalloc(ExtentDallocI value)
Sets the specified value to thedalloc
field.ExtentDecommit
decommit()
Returns the value of thedecommit
field.ExtentHooks
decommit(ExtentDecommitI value)
Sets the specified value to thedecommit
field.ExtentDestroy
destroy()
Returns the value of thedestroy
field.ExtentHooks
destroy(ExtentDestroyI value)
Sets the specified value to thedestroy
field.static ExtentHooks
malloc()
Returns a newExtentHooks
instance allocated withmemAlloc
.static ExtentHooks
mallocStack()
Returns a newExtentHooks
instance allocated on the thread-localMemoryStack
.static ExtentHooks
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
.ExtentMerge
merge()
Returns the value of themerge
field.ExtentHooks
merge(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
.ExtentPurge
purge_forced()
Returns the value of thepurge_forced
field.ExtentHooks
purge_forced(ExtentPurgeI value)
Sets the specified value to thepurge_forced
field.ExtentPurge
purge_lazy()
Returns the value of thepurge_lazy
field.ExtentHooks
purge_lazy(ExtentPurgeI value)
Sets the specified value to thepurge_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 thesplit
field.ExtentHooks
split(ExtentSplitI value)
Sets the specified value to thesplit
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
ExtentHooks
public ExtentHooks(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
alloc
public ExtentAlloc alloc()
Returns the value of thealloc
field.
-
dalloc
@Nullable public ExtentDalloc dalloc()
Returns the value of thedalloc
field.
-
destroy
@Nullable public ExtentDestroy destroy()
Returns the value of thedestroy
field.
-
commit
@Nullable public ExtentCommit commit()
Returns the value of thecommit
field.
-
decommit
@Nullable public ExtentDecommit decommit()
Returns the value of thedecommit
field.
-
purge_lazy
@Nullable public ExtentPurge purge_lazy()
Returns the value of thepurge_lazy
field.
-
purge_forced
@Nullable public ExtentPurge purge_forced()
Returns the value of thepurge_forced
field.
-
split
@Nullable public ExtentSplit split()
Returns the value of thesplit
field.
-
merge
@Nullable public ExtentMerge merge()
Returns the value of themerge
field.
-
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 newExtentHooks
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static ExtentHooks calloc()
Returns a newExtentHooks
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static ExtentHooks create()
Returns a newExtentHooks
instance allocated withBufferUtils
.
-
create
public static ExtentHooks create(long address)
Returns a newExtentHooks
instance for the specified memory address.
-
createSafe
@Nullable public static ExtentHooks createSafe(long address)
-
mallocStack
public static ExtentHooks mallocStack()
Returns a newExtentHooks
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static ExtentHooks callocStack()
Returns a newExtentHooks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static ExtentHooks mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static ExtentHooks callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newExtentHooks
instance allocated on the specifiedMemoryStack
and 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
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-