question about g_mem_profile()



Please see attached example. The output of g_mem_profile() shows two
blocks of unfreed memory. I'm guessing these have something to do with
the GAllocators used by the GList, but it makes g_mem_profile() sort of
useless to me since there is nothing I can do about it. Or is there?

If I add another call to g_mem_profile() anywhere in the program then
the subsequent calls (the atexit call in my case) show many more unfreed
blocks of various sizes. So it is very difficult to distinguish between
the "overhead" and a memory leak in my code.

Perhaps I'm doing something wrong? Wouldn't be the first time. But what
really concerns me is when my real program is ported to Win32. Since
Windows is notoriously bad at cleaning up after leaky programs, is this
overhead going to be a bug? Perhaps the DllMain() takes care of it
properly...

-- 
Alan M. Evans <alan extratech com>

Attachment: profile.c
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]