Next: , Up: Memory Management


2.14.1 Replacing Default Memory Manager

To replace the default memory manager some resource_set.free, resource_set.link and resource_set.mode methods along a resource_set.context memory management context attribute must be set in the struct x1f4_attributes_type record argument of the expression parsing function. The X1f4_E4_RESOURCE bit must be set in the flags argument of the expression parsing function to inform the expression evaluator that the memory management field are valid and that it has to pay attention to them.

See Generation Flags.

See struct x1f4_attributes_type.

The three methods are more or less the standard C library free, malloc and realloc function equivalents. Whenever the expression evaluator issues a call to any of the three method the memory management context is passed as the first argument. The memory management context is otherwise uninterpreted by the expression evaluator.

The methods are expect to return 0 for success, non 0 for failure.