Top Description Fields Constructors Methods
org.lwjgl.system.jemalloc

public Class ExtentHooks

extends Struct<ExtentHooks>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct extent_hooks_t
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

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;
}

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
ALLOC

The struct member offsets.

public static final int
COMMIT

The struct member offsets.

public static final int
DALLOC

The struct member offsets.

public static final int
DECOMMIT

The struct member offsets.

public static final int
DESTROY

The struct member offsets.

public static final int
MERGE

The struct member offsets.

public static final int
PURGE_FORCED

The struct member offsets.

public static final int
PURGE_LAZY

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
SPLIT

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
ExtentHooks(long address, ByteBuffer container)

public
ExtentHooks(ByteBuffer container)

Creates a ExtentHooks instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public ExtentAlloc
alloc()

the extent allocation hook

public ExtentHooks
alloc(ExtentAllocI value)

Sets the specified value to the alloc field.

public static ExtentHooks
calloc()

Returns a new ExtentHooks instance allocated with memCalloc.

public static ExtentHooks
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new ExtentHooks instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static ExtentHooks
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static ExtentHooks
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public ExtentCommit
commit()

the extent commit hook

public ExtentHooks
commit(ExtentCommitI value)

Sets the specified value to the commit field.

protected ExtentHooks
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static ExtentHooks
create()

Returns a new ExtentHooks instance allocated with BufferUtils.

public static ExtentHooks
create(long address)

Returns a new ExtentHooks instance for the specified memory address.

public static ExtentHooks
createSafe(long address)

Like create, but returns null if address is NULL.

public ExtentDalloc
dalloc()

the extent deallocation hook

public ExtentHooks
dalloc(ExtentDallocI value)

Sets the specified value to the dalloc field.

public ExtentDecommit
decommit()

the extent decommit hook

public ExtentHooks
decommit(ExtentDecommitI value)

Sets the specified value to the decommit field.

public ExtentDestroy
destroy()

the extent destruction hook

public ExtentHooks
destroy(ExtentDestroyI value)

Sets the specified value to the destroy field.

public static ExtentHooks
malloc()

Returns a new ExtentHooks instance allocated with memAlloc.

public static ExtentHooks
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new ExtentHooks instance allocated on the specified MemoryStack.

public static ExtentHooks
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static ExtentHooks
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public ExtentMerge
merge()

the extent merge hook

public ExtentHooks
merge(ExtentMergeI value)

Sets the specified value to the merge field.

public static ExtentAlloc
nalloc(long struct)

Unsafe version of alloc.

public static void
nalloc(long struct, ExtentAllocI value)

Unsafe version of alloc.

public static ExtentCommit
ncommit(long struct)

Unsafe version of commit.

public static void
ncommit(long struct, ExtentCommitI value)

Unsafe version of commit.

public static ExtentDalloc
ndalloc(long struct)

Unsafe version of dalloc.

public static void
ndalloc(long struct, ExtentDallocI value)

Unsafe version of dalloc.

public static ExtentDecommit
ndecommit(long struct)

Unsafe version of decommit.

public static void
ndecommit(long struct, ExtentDecommitI value)

Unsafe version of decommit.

public static ExtentDestroy
ndestroy(long struct)

Unsafe version of destroy.

public static void
ndestroy(long struct, ExtentDestroyI value)

Unsafe version of destroy.

public static ExtentMerge
nmerge(long struct)

Unsafe version of merge.

public static void
nmerge(long struct, ExtentMergeI value)

Unsafe version of merge.

public static ExtentPurge
npurge_forced(long struct)

Unsafe version of purge_forced.

public static void
npurge_forced(long struct, ExtentPurgeI value)

Unsafe version of purge_forced.

public static ExtentPurge
npurge_lazy(long struct)

Unsafe version of purge_lazy.

public static void
npurge_lazy(long struct, ExtentPurgeI value)

Unsafe version of purge_lazy.

public static ExtentSplit
nsplit(long struct)

Unsafe version of split.

public static void
nsplit(long struct, ExtentSplitI value)

Unsafe version of split.

public ExtentPurge
purge_forced()

the extent forced purge hook

public ExtentHooks
purge_forced(ExtentPurgeI value)

Sets the specified value to the purge_forced field.

public ExtentPurge
purge_lazy()

the extent lazy purge hook

public ExtentHooks
purge_lazy(ExtentPurgeI value)

Sets the specified value to the purge_lazy field.

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.

public ExtentHooks

Returns:

this struct
set
(ExtentHooks
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public ExtentSplit
split()

the extent split hook

public ExtentHooks
split(ExtentSplitI value)

Sets the specified value to the split field.

public static void
validate(long
the struct to validate
struct
)

Validates pointer members that should not be NULL.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

ALLOCback to summary
public static final int ALLOC

The struct member offsets.

COMMITback to summary
public static final int COMMIT

The struct member offsets.

DALLOCback to summary
public static final int DALLOC

The struct member offsets.

DECOMMITback to summary
public static final int DECOMMIT

The struct member offsets.

DESTROYback to summary
public static final int DESTROY

The struct member offsets.

MERGEback to summary
public static final int MERGE

The struct member offsets.

PURGE_FORCEDback to summary
public static final int PURGE_FORCED

The struct member offsets.

PURGE_LAZYback to summary
public static final int PURGE_LAZY

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

SPLITback to summary
public static final int SPLIT

The struct member offsets.

Constructor Detail

ExtentHooksback to summary
protected ExtentHooks(long address, ByteBuffer container)
ExtentHooksback to summary
public ExtentHooks(ByteBuffer container)

Creates a 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.

Method Detail

allocback to summary
public ExtentAlloc alloc()

the extent allocation hook

Annotations
@NativeType:extent_alloc_t
allocback to summary
public ExtentHooks alloc(ExtentAllocI value)

Sets the specified value to the alloc field.

callocback to summary
public static ExtentHooks calloc()

Returns a new ExtentHooks instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static ExtentHooks calloc(MemoryStack stack)

Returns a new ExtentHooks instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static ExtentHooks callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static ExtentHooks callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
commitback to summary
public ExtentCommit commit()

the extent commit hook

Annotations
@Nullable
@NativeType:extent_commit_t
commitback to summary
public ExtentHooks commit(ExtentCommitI value)

Sets the specified value to the commit field.

createback to summary
protected ExtentHooks create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static ExtentHooks create()

Returns a new ExtentHooks instance allocated with BufferUtils.

createback to summary
public static ExtentHooks create(long address)

Returns a new ExtentHooks instance for the specified memory address.

createSafeback to summary
public static ExtentHooks createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
dallocback to summary
public ExtentDalloc dalloc()

the extent deallocation hook

Annotations
@Nullable
@NativeType:extent_dalloc_t
dallocback to summary
public ExtentHooks dalloc(ExtentDallocI value)

Sets the specified value to the dalloc field.

decommitback to summary
public ExtentDecommit decommit()

the extent decommit hook

Annotations
@Nullable
@NativeType:extent_decommit_t
decommitback to summary
public ExtentHooks decommit(ExtentDecommitI value)

Sets the specified value to the decommit field.

destroyback to summary
public ExtentDestroy destroy()

the extent destruction hook

Annotations
@Nullable
@NativeType:extent_destroy_t
destroyback to summary
public ExtentHooks destroy(ExtentDestroyI value)

Sets the specified value to the destroy field.

mallocback to summary
public static ExtentHooks malloc()

Returns a new ExtentHooks instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static ExtentHooks malloc(MemoryStack stack)

Returns a new ExtentHooks instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static ExtentHooks mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static ExtentHooks mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mergeback to summary
public ExtentMerge merge()

the extent merge hook

Annotations
@Nullable
@NativeType:extent_merge_t
mergeback to summary
public ExtentHooks merge(ExtentMergeI value)

Sets the specified value to the merge field.

nallocback to summary
public static ExtentAlloc nalloc(long struct)

Unsafe version of alloc.

nallocback to summary
public static void nalloc(long struct, ExtentAllocI value)

Unsafe version of alloc.

ncommitback to summary
public static ExtentCommit ncommit(long struct)

Unsafe version of commit.

Annotations
@Nullable
ncommitback to summary
public static void ncommit(long struct, ExtentCommitI value)

Unsafe version of commit.

ndallocback to summary
public static ExtentDalloc ndalloc(long struct)

Unsafe version of dalloc.

Annotations
@Nullable
ndallocback to summary
public static void ndalloc(long struct, ExtentDallocI value)

Unsafe version of dalloc.

ndecommitback to summary
public static ExtentDecommit ndecommit(long struct)

Unsafe version of decommit.

Annotations
@Nullable
ndecommitback to summary
public static void ndecommit(long struct, ExtentDecommitI value)

Unsafe version of decommit.

ndestroyback to summary
public static ExtentDestroy ndestroy(long struct)

Unsafe version of destroy.

Annotations
@Nullable
ndestroyback to summary
public static void ndestroy(long struct, ExtentDestroyI value)

Unsafe version of destroy.

nmergeback to summary
public static ExtentMerge nmerge(long struct)

Unsafe version of merge.

Annotations
@Nullable
nmergeback to summary
public static void nmerge(long struct, ExtentMergeI value)

Unsafe version of merge.

npurge_forcedback to summary
public static ExtentPurge npurge_forced(long struct)

Unsafe version of purge_forced.

Annotations
@Nullable
npurge_forcedback to summary
public static void npurge_forced(long struct, ExtentPurgeI value)

Unsafe version of purge_forced.

npurge_lazyback to summary
public static ExtentPurge npurge_lazy(long struct)

Unsafe version of purge_lazy.

Annotations
@Nullable
npurge_lazyback to summary
public static void npurge_lazy(long struct, ExtentPurgeI value)

Unsafe version of purge_lazy.

nsplitback to summary
public static ExtentSplit nsplit(long struct)

Unsafe version of split.

Annotations
@Nullable
nsplitback to summary
public static void nsplit(long struct, ExtentSplitI value)

Unsafe version of split.

purge_forcedback to summary
public ExtentPurge purge_forced()

the extent forced purge hook

Annotations
@Nullable
@NativeType:extent_purge_t
purge_forcedback to summary
public ExtentHooks purge_forced(ExtentPurgeI value)

Sets the specified value to the purge_forced field.

purge_lazyback to summary
public ExtentPurge purge_lazy()

the extent lazy purge hook

Annotations
@Nullable
@NativeType:extent_purge_t
purge_lazyback to summary
public ExtentHooks purge_lazy(ExtentPurgeI value)

Sets the specified value to the purge_lazy field.

setback to summary
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.

setback to summary
public ExtentHooks set(ExtentHooks src)

Copies the specified struct data to this struct.

Parameters
src:ExtentHooks

the source struct

Returns:ExtentHooks

this struct

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
splitback to summary
public ExtentSplit split()

the extent split hook

Annotations
@Nullable
@NativeType:extent_split_t
splitback to summary
public ExtentHooks split(ExtentSplitI value)

Sets the specified value to the split field.

validateback to summary
public static void validate(long struct)

Validates pointer members that should not be NULL.

Parameters
struct:long

the struct to validate