On 2016-09-28 00:23:11 +0100, Greg Stark wrote:
> On Tue, Sep 27, 2016 at 11:02 PM, Andres Freund <and...@anarazel.de> wrote:
> > Any plans to pick this up again?
> 
> Yeah, I was just thinking I should pick this up again.
> 
> > I vote for renaming the VALGRIND names etc. to something more tool-neutral. 
> > I think it's going to be too confusing otherwise.
> 
> Hm, the danger there is once I start refactoring things I could get
> bogged down...

Meh, adding a neutral name seems pretty harmless.

> I would love to remove all the #ifdef's and have the
> macros just be no-ops if they're compiled out for example...

Don't we pretty much have that?

#ifdef USE_VALGRIND
#include <valgrind/memcheck.h>
#else
#define VALGRIND_CHECK_MEM_IS_DEFINED(addr, size)                       do {} 
while (0)
#define VALGRIND_CREATE_MEMPOOL(context, redzones, zeroed)      do {} while (0)
#define VALGRIND_DESTROY_MEMPOOL(context)                                       
do {} while (0)
#define VALGRIND_MAKE_MEM_DEFINED(addr, size)                           do {} 
while (0)
#define VALGRIND_MAKE_MEM_NOACCESS(addr, size)                          do {} 
while (0)
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size)                         do {} 
while (0)
#define VALGRIND_MEMPOOL_ALLOC(context, addr, size)                     do {} 
while (0)
#define VALGRIND_MEMPOOL_FREE(context, addr)                            do {} 
while (0)
#define VALGRIND_MEMPOOL_CHANGE(context, optr, nptr, size)      do {} while (0)
#endif

?


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to