Subj : Re: where can I find a malloc for standalone programs ? To : comp.programming From : Rob Thorpe Date : Mon Aug 22 2005 02:27 am DEMAINE Benoit-Pierre wrote: > > You will have to write the function "sbrk" that malloc relies on > > yourself for your environment. > > > > everybody is tellign me aboun that sbrk, and i have no clue > what it is about ... > > the environmetn is what I write: no kernel, no system. > > just my code, and those ~80 bytes ASM to activate cahes, > configure coprocessors, and set up various 'stupid things'. sbrk is the traditional name in Unix for the call that resizes the data segment of the program. In a system with an operating system a call to sbrk will make the data segement larger or smaller. In an embedded system like yours with only one program it's probably only necessary that "sbrk" record the size of the data segment somewhere, and return an error when it can't be expanded any further. See the rest of the thread. .