alloc_InitSegment()

[<<<] [>>>]

Call this function to get a new segment. You should specify the functions that the segement should use to get memory from the operating system, and the function the segment should use to release the memory to the operating system. These functions should be like malloc and free.

If the second argument is NULL then the function will treat the first argument as an already allocated and initialized memory segment and the memory allocation and freeing functions will be inherited from that segment.

void *alloc_InitSegment(void * (*maf)(size_t), /* a 'malloc' and a 'free' like functions */
                        void   (*mrf)(void *)
  )@{

The return value is a void* pointer which identifies the segment and should be passed to the other functions as segment argument.

The first argument is the malloc like function and the second if the free like function.


[<<<] [>>>]