Class ForeignAllocation

java.lang.Object
org.apache.arrow.memory.ForeignAllocation

public abstract class ForeignAllocation extends Object
EXPERIMENTAL: a memory allocation that does not come from a BufferAllocator, but rather an outside source (like JNI).

To use this, subclass this class and implement release0() to free the allocation.

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ForeignAllocation(long size, long memoryAddress)
    Create a new AllocationManager representing an imported buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the size of this allocation.
    protected long
    Get the address of this allocation.
    protected abstract void
    Free this allocation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ForeignAllocation

      protected ForeignAllocation(long size, long memoryAddress)
      Create a new AllocationManager representing an imported buffer.
      Parameters:
      size - The buffer size.
      memoryAddress - The buffer address.
  • Method Details

    • getSize

      public long getSize()
      Get the size of this allocation.
    • memoryAddress

      protected long memoryAddress()
      Get the address of this allocation.
    • release0

      protected abstract void release0()
      Free this allocation. Will only be called once.