News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Memory Management

Started by tommy, January 01, 2007, 01:28:25 PM

Previous topic - Next topic

tommy

@Pelle: Say if I allocate memory blocks throughout the program which has to be available till the program is terminated, do I actually need to loop through all the allocated memory handles and free them afterwards to avoid memory leaks? Or do Pelles C allocate memory in a heap which is automatically freed on exit? After a quick view in OllyDbg I see a reference to HeapCreate, but I haven't had a closer look at it. If you could give me a hint that would be nice. I got other things to do than researching right now. :)

A happy new year to all of you! Keep up the good work Pelle!

Pelle

The small block heap, and the large block heap (where the Heap* API functions are used) will be released 'automagically' when the program terminates, so you don't need to use free() youself (but it may be considered 'good style', when possible...)
/Pelle

tommy

Ah, yes, as I thought... Thanks!