Pelles C forum

C language => User contributions => Topic started by: JohnF on June 07, 2005, 04:07:03 pm

Title: Tmalloc
Post by: JohnF on June 07, 2005, 04:07:03 pm
It can be difficult to track down memory leaks when using malloc especially in large projects.

Tmalloc should be used for that purpose.

Generally, call report_heap() just before your app terminates, this will report any allocated memory blocks that were not released, giving the file/module name and line number where the memory was allocated.

TMalloc was originally developed solely to check for memory leaks when using malloc-ed memory. Since then it has expanded to check for buffer over-runs for various string functions.

See tmalloc.h for further comments regarding malloc and family functions.

(I'd just fixed a bug in Tmalloc and thought of contributing it here)

EDIT: found another bug so removed the attachment.

John
Title: Re: Tmalloc
Post by: tiwag on June 07, 2005, 05:27:46 pm
Quote from: "JohnF"
...I'd just fixed a bug in Tmalloc and thought of contributing it here

John


Hello John !

GREAT !
thanks a lot !
Title: Re: Tmalloc
Post by: JohnF on June 07, 2005, 05:44:15 pm
Quote from: "tiwag"
Quote from: "JohnF"
...I'd just fixed a bug in Tmalloc and thought of contributing it here

John


Hello John !

GREAT !
thanks a lot !


Removed it because I found anther bug, will upload it when fixed. Sorry about that!

John
Title: Tmalloc
Post by: JohnF on June 07, 2005, 07:09:31 pm
Ok, I think it's fixed, here is it again.

edit; OOPS, replaced the attachment with a PellesC project.

John