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

xerial.larray.buffer.OffHeapMemoryReference Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package xerial.larray.buffer;

import java.lang.ref.ReferenceQueue;

/**
 * @author Taro L. Saito
 */
public class OffHeapMemoryReference extends MemoryReference {

    /**
     * Create a phantom reference
     * @param m the allocated memory
     * @param queue the reference queue to which GCed reference of the Memory will be inserted
     */
    public OffHeapMemoryReference(Memory m, ReferenceQueue queue) {
        super(m, queue);
    }

    public Memory toMemory() {
        if(address != 0)
            return new OffHeapMemory(address);
        else
            return new OffHeapMemory();
    }

    public String name() { return "off-heap"; }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy