|
From: Erdem G. <zu...@ya...> - 2004-12-04 15:42:11
|
Hi,
I use
VALGRIND_CREATE_MEMPOOL
VALGRIND_MEMPOOL_ALLOC
VALGRIND_MEMPOOL_FREE
macros for my memory pool.
I want to report un-freed allocations at the exit but
I can't find a way.
I tried these solutions:
1- Search pool for nonfree chunks and try to
VALGRIND_MEMPOOL_FREE
with chunk address+1 so valgrind reports as
invalid free.
Problem: As I don't use redzones, valgrind report
address as 1 byte
after
previouse block.
2- Tried to hack valgrind to add a client-request to
print info about
given address
so I can call it for un-freed chunks.
Problem: Structure of valgrind is very
complicated. So I decide to
ask for help.
Thanks
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
|
|
From: Robert W. <rj...@du...> - 2004-12-04 21:50:11
|
> I use > VALGRIND_CREATE_MEMPOOL > VALGRIND_MEMPOOL_ALLOC > VALGRIND_MEMPOOL_FREE > macros for my memory pool. >=20 > I want to report un-freed allocations at the exit but > I can't find a way. Yeah, it doesn't do that right now. I suppose it would be useful. I'll try allocate some time before the end of the year to get this done, but if you're in a hurry, you might want to try hacking on it yourself. Right now, MAC_(do_detect_memory_leaks) in mac_leakcheck.c only looks at the stuff attached to MAC_(malloc_list), which is a hash table of regular (i.e. non-mempool) allocated memory. This would also need to look at MAC_(mempool_list), which is a hash table of MAC_Mempool structures. Each structure contains a "chunks" member, which is a hash table of allocations in that memory pool. You'd need to search each one of these, too. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |