Subj : Re: malloc() To : borland.public.cpp.borlandcpp From : Jan Vernimmen Date : Thu Jun 24 2004 12:57 pm Hello Bob, I am indeed targeting Windows. I can try your suggestions, but did you read the answer given by Ed Mulroy? Jan. Bob Gonder wrote: > Jan Vernimmen wrote: > > >>I was at the point to take a deep breath and rewrite everything using new() >>and delete() where I'm using malloc() and free() now. > > > You are targeting Windows, now, right? > Then why not use the Windows allocation? > > pointer = GlobalAlloc( GMEM_FIXED | GMEM_ZEROINIT, howmuch ); > GlobalFree( pointer ); > > AFAIK the GMEM_FIXED blocks don't have many issues. > To try it, you could wrap them in your own versions of malloc() and > free(), and just rebuild. > > void * malloc(size_t size) > { return GLobalAlloc(GMEM_FIXED,size); > } > .