Class MemVTable

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class MemVTable extends ProxyInstance

A set of functions used to perform memory allocation. The same GMemVTable must be used for all allocations in the same program; a call to g_mem_set_vtable(), if it exists, should be prior to any use of GLib.

This functions related to this has been deprecated in 2.46, and no longer work.

  • Constructor Details

    • MemVTable

      public MemVTable(MemorySegment address)
      Create a MemVTable proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • MemVTable

      public MemVTable(Arena arena)
      Allocate a new MemVTable.
      Parameters:
      arena - to control the memory allocation scope
    • MemVTable

      public MemVTable()
      Allocate a new MemVTable. The memory is allocated with Arena.ofAuto().
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • overrideMalloc

      public void overrideMalloc(MemVTable.MallocCallback malloc, Arena _arena)
      Write a value in the field malloc.
      Parameters:
      malloc - The new value for the field malloc
      _arena - to control the memory allocation scope
    • overrideRealloc

      public void overrideRealloc(MemVTable.ReallocCallback realloc, Arena _arena)
      Write a value in the field realloc.
      Parameters:
      realloc - The new value for the field realloc
      _arena - to control the memory allocation scope
    • overrideFree

      public void overrideFree(MemVTable.FreeCallback free, Arena _arena)
      Write a value in the field free.
      Parameters:
      free - The new value for the field free
      _arena - to control the memory allocation scope
    • overrideCalloc

      public void overrideCalloc(MemVTable.CallocCallback calloc, Arena _arena)
      Write a value in the field calloc.
      Parameters:
      calloc - The new value for the field calloc
      _arena - to control the memory allocation scope
    • overrideTryMalloc

      public void overrideTryMalloc(MemVTable.TryMallocCallback tryMalloc, Arena _arena)
      Write a value in the field try_malloc.
      Parameters:
      tryMalloc - The new value for the field try_malloc
      _arena - to control the memory allocation scope
    • overrideTryRealloc

      public void overrideTryRealloc(MemVTable.TryReallocCallback tryRealloc, Arena _arena)
      Write a value in the field try_realloc.
      Parameters:
      tryRealloc - The new value for the field try_realloc
      _arena - to control the memory allocation scope