|
From: Yeshurun, M. <mei...@in...> - 2005-07-10 07:10:06
|
Hi, =20 When your program manages a pool of memory (which was allocated using malloc), Valgrind will think that different blocks from the pool are part of a single block and will not recognize overriding errors. =20 Is there any way to let Valgrind know that a function other than malloc, calloc etc. is a function which allocates a block of memory? =20 (I would be happy to try and do this myself, but I would like to make sure that a feature that can solve this problem doesn't already exist.) =20 =20 Thanks, =20 Meir |
|
From: Robert W. <rj...@du...> - 2005-07-10 07:49:12
|
> Is there any way to let Valgrind know that a function other than > malloc, calloc etc. is a function which allocates a block of memory? There are two ways of doing this. Both involve using client requests. The first way is to use VALGRIND_MALLOCLIKE_BLOCK and VALGRIND_FREELIKE_BLOCK. The second is to use VALGRIND_CREATE_MEMPOOL, VALGRIND_DESTROY_MEMPOOL, VALGRIND_MEMPOOL_ALLOC and VALGRIND_MEMPOOL_FREE. Both mechanisms are documented here: http://www.valgrind.org/docs/manual/coregrind_core.html#clientreq although the mempool stuff needs way more documentation (mea culpa) and I usually just point people at the example in memcheck/tests/mempool.c. If you have any questions about the mempool stuff after reading this file, drop me a line. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |