Class ChunkHooks

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer


    public class ChunkHooks
    extends Struct
    Comprises function pointers which are described individually below. jemalloc uses these functions to manage chunk 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 chunks for later reuse. Cleanup attempts cascade from deallocation to decommit to purging, which gives the chunk management functions opportunities to reject the most permanent cleanup operations in favor of less permanent (and often less costly) operations. The chunk splitting and merging operations can also be opted out of, but this is mainly intended to support platforms on which virtual memory mappings provided by the operating system kernel do not automatically coalesce and split, e.g. Windows.

    Member documentation

    • alloc – the chunk allocation hook
    • dalloc – the chunk deallocation hook
    • commit – the chunk commit hook
    • decommit – the chunk decommit hook
    • purge – the chunk purge hook
    • split – the chunk split hook
    • merge – the chunk merge hook

    Layout

    struct chunk_hooks_t {
        chunk_alloc_t alloc;
        chunk_dalloc_t dalloc;
        chunk_commit_t commit;
        chunk_decommit_t decommit;
        chunk_purge_t purge;
        chunk_split_t split;
        chunk_merge_t merge;
    }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • ChunkHooks

        public ChunkHooks(java.nio.ByteBuffer container)
        Creates a ChunkHooks 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.