Pelles C forum

Pelles C => General discussions => Topic started by: tommy on January 01, 2007, 01:28:25 PM

Title: Memory Management
Post by: tommy on January 01, 2007, 01:28:25 PM
@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!
Title: Memory Management
Post by: Pelle on January 03, 2007, 03:23:08 PM
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...)
Title: Memory Management
Post by: tommy on January 03, 2007, 06:55:35 PM
Ah, yes, as I thought... Thanks!