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

org.lwjgl.system.rpmalloc.RPErrorCallback 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 org.jspecify.annotations.*;

import org.lwjgl.system.*;

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

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

Type

* *

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy