Click or drag to resize
gmp_libmp_get_memory_functions Method
Get the current allocation functions, storing function pointers to the locations given by the arguments.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static void mp_get_memory_functions(
	ref allocate_function alloc_func_ptr,
	ref reallocate_function realloc_func_ptr,
	ref free_function free_func_ptr
)

Parameters

alloc_func_ptr
Type: Math.Gmp.Nativeallocate_function
The memory allocation function.
realloc_func_ptr
Type: Math.Gmp.Nativereallocate_function
The memory reallocation function.
free_func_ptr
Type: Math.Gmp.Nativefree_function
The memory de-allocation function.
Examples
allocate_function allocate;
reallocate_function reallocate;
free_function free;

// Retrieve the GMP memory allocation functions.
allocate = null;
reallocate = null;
free = null;
gmp_lib.mp_get_memory_functions(ref allocate, ref reallocate, ref free);
Assert.IsTrue(allocate != null && reallocate != null && free != null);

// Allocate and free memory.
void_ptr p = allocate(100);
free(p, 100);
See Also