|
From: Greg P. <gp...@us...> - 2005-02-24 03:45:25
|
Jeremy Fitzhardinge writes: > I prefer the callback approach to > passing around arrays, because it doesn't expose the representation of > the arch registers (since it only needs to look at general-purpose > registers which might possibly hold pointers, which might not be > contigious in memory for a particular architecture). On some architectures (e.g. Mac OS X on PowerPC) you need to scan registers other than the general-purpose ones. If you catch optimized, unrolled memmove() at the wrong point, a floating-point or vector register could contain the only extant copy of a pointer value. You'd have to be pretty unlucky to hit this while using Valgrind's leak check, so it may not be worth worrying about. There's also the very special G5 register that holds pthread_self, which is a heap block that can root other heap blocks via thread-specific data. I'm not sure whether that register is ever the only copy of any particular pthread_self, though. Something in Valgrind would need to know which architecture registers might hold pointer values. I don't know whether it should be the core or the tool, though. -- Greg Parker gp...@us... |