Function

NumCosmoMathMemoryPoolnew

Declaration [src]

NcmMemoryPool*
ncm_memory_pool_new (
  NcmMemoryPoolAlloc mp_alloc,
  gpointer userdata,
  GDestroyNotify mp_free
)

Description [src]

This function prepare a memory pool which allocate memory using mp_alloc and save it for future use, the memory must be returned to the pool using #ncm_memory_pool_return. These functions are thread safe.

This function is not directly available to language bindings.

Parameters

mp_alloc

Type: NcmMemoryPoolAlloc

A NcmMemoryPoolAlloc, function used to alloc memory.

userdata

Type: gpointer

Userdata pointer for mp_alloc function.

The argument can be NULL.
The data is owned by the caller of the function.
mp_free

Type: GDestroyNotify

Function used to free memory alloced by mp_alloc.

Return value

Type: NcmMemoryPool

The memory pool NcmMemoryPool.

The data is owned by the called function.