|
From: Behdad E. <be...@cs...> - 2006-06-03 01:56:50
|
On Fri, 2 Jun 2006, Nicholas Nethercote wrote: > On Fri, 2 Jun 2006, Behdad Esfahbod wrote: > > >> Behdad, I can think of three possible ways of incorporating valgrind.h: > >> > >> 1. copying it directly into a C file (clearly silly) > >> 2. making a local copy in your project and #include'ing that > >> 3. #include'ing the installed copy from $INSTALL/include > >> > >> Number 3 is the intended method. Are you doing number 2? It's not clear to > >> me because if you do number 3 I don't see why you should have problems with > >> version mismatches between valgrind.h and the Valgrind program. > > > > Ah, ok. Yes, I was doing number 2, and the gslice maintainer had > > my same reading of "for inclusion into client (your!) code". > > It turns out the manual recommends #2. Hmm. And #2 is a lot easier maintenance-wise, fewer dependencies on client package, even if it's a soft dependency. > > BTW, I'm willing to work on a patch to make MALLOCLIKE inside > > malloc'ed block work, should you tell me what kind of approach > > you prefer. > > My IGNORE_HEAP_BLOCK approach is flawed because it didn't handle freeing of > the superblock. One way is to add a FAKE_MALLOC(mem) that should be called right before the free() call to create a block entry (with zero length). > You mentioned having a valgrind.h versioning system to avoid the problem of > a Valgrind possibly having MALLOCLIKE/FREELIKE but not IGNORE_*. Better I > think would be another request SUPPORTS_IGNORE_REQUESTS. You could query > that first. Version numbers are a pain, because they're arbitrary, and it's > easy to forget to update them. (We've found that with the internal > core/tool versioning system we have.) The problem with a SUPPORTS_IGNORE_REQUESTS is that the approach doesn't scale well. The version number on the other hand works pretty well, assuming that valgrind doesn't break backwards compatibility. Then one can simply for the minimum version they require, instead of asking for a new SUPPORTS_* hint to be added to the next version. As for updating them, I'm not suggesting a new interface version, just the valgrind version, and that's handled automatically by the build system. > Nick --behdad http://behdad.org/ "Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill" -- Dan Bern, "New American Language" |