All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.system.rpmalloc.RPMemoryMapCallback Maven / Gradle / Ivy

Go to download

A public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.system.rpmalloc;

import javax.annotation.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;

/**
 * Instances of this class may be set to the {@link RPMallocConfig} struct.
 * 
 * 

Type

* *

 * void * (*) (
 *     size_t size,
 *     size_t *offset
 * )
*/ public abstract class RPMemoryMapCallback extends Callback implements RPMemoryMapCallbackI { /** * Creates a {@code RPMemoryMapCallback} instance from the specified function pointer. * * @return the new {@code RPMemoryMapCallback} */ public static RPMemoryMapCallback create(long functionPointer) { RPMemoryMapCallbackI instance = Callback.get(functionPointer); return instance instanceof RPMemoryMapCallback ? (RPMemoryMapCallback)instance : new Container(functionPointer, instance); } /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ @Nullable public static RPMemoryMapCallback createSafe(long functionPointer) { return functionPointer == NULL ? null : create(functionPointer); } /** Creates a {@code RPMemoryMapCallback} instance that delegates to the specified {@code RPMemoryMapCallbackI} instance. */ public static RPMemoryMapCallback create(RPMemoryMapCallbackI instance) { return instance instanceof RPMemoryMapCallback ? (RPMemoryMapCallback)instance : new Container(instance.address(), instance); } protected RPMemoryMapCallback() { super(SIGNATURE); } RPMemoryMapCallback(long functionPointer) { super(functionPointer); } private static final class Container extends RPMemoryMapCallback { private final RPMemoryMapCallbackI delegate; Container(long functionPointer, RPMemoryMapCallbackI delegate) { super(functionPointer); this.delegate = delegate; } @Override public long invoke(long size, long offset) { return delegate.invoke(size, offset); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy