ec_memtype_register
Name
ec_memtype_register — Register a new memtype with the system
Synopsis
#include "ec_malloc.h"
| int **ec_memtype_register** (
| def)
; | |
Description
Register a new memtype with the system. The build-in memtypes are enumerated at the section called “Memory Types”.
Given a mem_type_def structure, this function registers the memtype with the allocator and returns the memtype id that can then be passed to calls to ec_malloc and related functions to allocate memory against that type.
- def
-
A constant pointer to a “ec_mem_type_def” struct.
The new memtype id, or MEMTYPE_REGISTER_FAILED
(-1) if the new type could not be registered.
Note that the definition structure is effectively copied; after this call returns, the allocator does not use the provided mem_type_def pointer, however, the memtype_description field must not be transient memory; its value is assumed to hold a valid value for the lifetime of the process.
It is legal to call this function in the Scheduler
thread.