I’m having trouble with the configuration and aplication of the malloc() function and other memory allocation commands in Dynamic C. I have some experience with the structure in C/C++, but it isn’t working with the Rabbit programming language.
Thank you.
It depends on the version of Dynamic C you are using. If you are using DC9.62 for Rabbit 2000/3000 there are no malloc/free functions.
If you are using DC10.72 for Rabbit 4000 and newer the functions are there. You can see the function description for malloc by going to Help - Function Lookup and typing in malloc:
malloc
SYNTAX: void far *malloc( size32_t size)
DESCRIPTION: Allocates space for an object.
PARAMETER 1: Size of the object, in bytes.
RETURN VALUE: Address of space allocated. If there isn’t enough memory
available, exits the program with an -ENOMEM error.
SEE ALSO: calloc, realloc, free,
_root_malloc, _root_calloc, _root_realloc, _root_free