Package org.gnome.glib
Class MemVTable
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.glib.MemVTable
- All Implemented Interfaces:
Proxy
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface declaration of theCallocCallback
callback.static interface
Functional interface declaration of theFreeCallback
callback.static interface
Functional interface declaration of theMallocCallback
callback.static interface
Functional interface declaration of theReallocCallback
callback.static interface
Functional interface declaration of theTryMallocCallback
callback.static interface
Functional interface declaration of theTryReallocCallback
callback. -
Constructor Summary
ConstructorDescriptionAllocate a new MemVTable.Allocate a new MemVTable.MemVTable
(MemorySegment address) Create a MemVTable proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.void
overrideCalloc
(MemVTable.CallocCallback calloc, Arena _arena) Write a value in the fieldcalloc
.void
overrideFree
(MemVTable.FreeCallback free, Arena _arena) Write a value in the fieldfree
.void
overrideMalloc
(MemVTable.MallocCallback malloc, Arena _arena) Write a value in the fieldmalloc
.void
overrideRealloc
(MemVTable.ReallocCallback realloc, Arena _arena) Write a value in the fieldrealloc
.void
overrideTryMalloc
(MemVTable.TryMallocCallback tryMalloc, Arena _arena) Write a value in the fieldtry_malloc
.void
overrideTryRealloc
(MemVTable.TryReallocCallback tryRealloc, Arena _arena) Write a value in the fieldtry_realloc
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
MemVTable
Create a MemVTable proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
MemVTable
Allocate a new MemVTable.- Parameters:
arena
- to control the memory allocation scope
-
MemVTable
public MemVTable()Allocate a new MemVTable. The memory is allocated withArena.ofAuto()
.
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
overrideMalloc
Write a value in the fieldmalloc
.- Parameters:
malloc
- The new value for the fieldmalloc
_arena
- to control the memory allocation scope
-
overrideRealloc
Write a value in the fieldrealloc
.- Parameters:
realloc
- The new value for the fieldrealloc
_arena
- to control the memory allocation scope
-
overrideFree
Write a value in the fieldfree
.- Parameters:
free
- The new value for the fieldfree
_arena
- to control the memory allocation scope
-
overrideCalloc
Write a value in the fieldcalloc
.- Parameters:
calloc
- The new value for the fieldcalloc
_arena
- to control the memory allocation scope
-
overrideTryMalloc
Write a value in the fieldtry_malloc
.- Parameters:
tryMalloc
- The new value for the fieldtry_malloc
_arena
- to control the memory allocation scope
-
overrideTryRealloc
Write a value in the fieldtry_realloc
.- Parameters:
tryRealloc
- The new value for the fieldtry_realloc
_arena
- to control the memory allocation scope
-