Technical Support

C51: MEMORY ALLOCATION


Information in this article applies to:

  • C51 All Versions

QUESTION

Is there any way to dynamically allocate memory on an 8051?

ANSWER

Yes. The source code for the memory allocation routines are found in the \KEIL\C51\LIB folder. You must set up the memory allocation routines to use XDATA for the memory pool. Check the following source files:

INIT_MEM.C (Initializes the memory pool)
CALLOC.C (Calloc routine)
FREE.C (Free routine)
MALLOC.C (Malloc routine)
REALLOC.C (Realloc routine)

Last Reviewed: Monday, May 17, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure