[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] Debugging Memory Manager added to FreeType sources
From: |
David Turner |
Subject: |
[Devel] Debugging Memory Manager added to FreeType sources |
Date: |
Mon, 22 Oct 2001 10:45:54 +0200 |
Hello,
I have just added a new source file, named "src/base/ftdbgmem.c", that
implements a simple debugging memory manager for FreeType. It is activated
by defining FT_DEBUG_MEMORY in "ftoption.h"
It will report simple errors like invalid reallocation requests, double
deletes, as well as memory leaks (when FT_Done_FreeType is called).
Note that it's basically the same thing that was previously in the
"ftmemchk.c" demo program, except that:
- the blocks are recorded with a hash table, which provides much
better performance than a linear list :o)
- all FreeType applications can easily benefit from it, so it can
be used to debug leaks and bugs that appear in "rare" situations,
not only in a single demo program..
- finally, using it requires much more memory than a typical build,
since it never really "free" the blocks allocated from the heap
(in order to detect double deletes easily..)
I'll probably make a few modifications in the future, like using an
environment variable to determine at run-time wether to use the debugging
manager or not..
Cheers,
- David
PS: And of course, this thing will go into the MLib as well..
- [Devel] Debugging Memory Manager added to FreeType sources,
David Turner <=