org.lwjgl.system.jemalloc.ExtentPurgeI Maven / Gradle / Ivy
Show all versions of lwjgl-jemalloc Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.system.jemalloc;
import org.lwjgl.system.*;
import static org.lwjgl.system.dyncall.DynCallback.*;
/** Instances of this interface may be set to the {@link ExtentHooks} struct. */
@FunctionalInterface
@NativeType("extent_purge_t")
public interface ExtentPurgeI extends CallbackI.Z {
String SIGNATURE = "(pppppi)B";
@Override
default String getSignature() { return SIGNATURE; }
@Override
default boolean callback(long args) {
return invoke(
dcbArgPointer(args),
dcbArgPointer(args),
dcbArgPointer(args),
dcbArgPointer(args),
dcbArgPointer(args),
dcbArgInt(args)
);
}
/**
* Extent purge hook.
*
* An extent purge function conforms to the {@code extent_purge_t} type and discards physical pages within the virtual memory mapping associated with an
* extent at given {@code addr} and {@code size} at {@code offset} bytes, extending for {@code length} on behalf of arena {@code arena_ind}. A lazy extent
* purge function (e.g. implemented via {@code madvise(..., MADV_FREE)}) can delay purging indefinitely and leave the pages within the purged virtual memory
* range in an indeterminite state, whereas a forced extent purge function immediately purges, and the pages within the virtual memory range will be
* zero-filled the next time they are accessed. If the function returns true, this indicates failure to purge.
*
* @param extent_hooks
* @param addr
* @param size
* @param offset
* @param length
* @param arena_ind
*/
@NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("size_t") long offset, @NativeType("size_t") long length, @NativeType("unsigned int") int arena_ind);
}