We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, there, The malloc always allocate memory at the tail of the memory initialized by init_mempool(). How to make "malloc()" allocate memory from the beginning of the initialized memory? In details, suppose running following code fragment,
byte xdata *M1; byte xdata *M2; init_mempool (&XBYTE [0x10], 0x1000); M1 = (byte xdata *) malloc (500); M2 = (byte xdata *) malloc (100);
Write your own implementation of malloc/free? In this case you even get to call them whatever you like, say my_malloc/my_free :-) There are plenty of resources on the Internet that will describe how that can be accomplished, not to mention Keil's implementation. - mike