diff --git a/config/extra/with-handholding.mk b/config/extra/with-handholding.mk index 81944c8297..506c17b73d 100644 --- a/config/extra/with-handholding.mk +++ b/config/extra/with-handholding.mk @@ -2,6 +2,6 @@ CPPFLAGS+=-DFD_EQVOC_USE_HANDHOLDING=1 CPPFLAGS+=-DFD_FORKS_USE_HANDHOLDING=1 CPPFLAGS+=-DFD_GHOST_USE_HANDHOLDING=1 CPPFLAGS+=-DFD_SCRATCH_USE_HANDHOLDING=1 +CPPFLAGS+=-DFD_SPAD_USE_HANDHOLDING=1 CPPFLAGS+=-DFD_TOWER_USE_HANDHOLDING=1 -# CPPFLAGS+=-DFD_TXN_HANDHOLDING=1 # DOES NOT WORK - +# CPPFLAGS+=-DFD_TXN_HANDHOLDING=1 # DOES NOT WORK \ No newline at end of file diff --git a/src/util/spad/fd_spad.c b/src/util/spad/fd_spad.c index 0f1da01937..82e8c22ff0 100644 --- a/src/util/spad/fd_spad.c +++ b/src/util/spad/fd_spad.c @@ -1,6 +1,20 @@ #include "fd_spad.h" #include "../log/fd_log.h" +/* FIXME: better ways to avoid macro definition conflicts? */ +#ifdef FD_SPAD_USE_HANDHOLDING +#undef fd_spad_alloc_max +#undef fd_spad_frame_lo +#undef fd_spad_frame_hi +#undef fd_spad_push +#undef fd_spad_pop +#undef fd_spad_alloc +#undef fd_spad_trim +#undef fd_spad_prepare +#undef fd_spad_cancel +#undef fd_spad_publish +#endif + int fd_spad_verify( fd_spad_t const * spad ) { diff --git a/src/util/spad/fd_spad.h b/src/util/spad/fd_spad.h index 2d233df7d1..d10136e77d 100644 --- a/src/util/spad/fd_spad.h +++ b/src/util/spad/fd_spad.h @@ -531,6 +531,28 @@ fd_spad_private_frame_end_debug( fd_spad_t ** _spad ) { #define FD_SPAD_FRAME_END_DEBUG while(0); } while(0) +#ifdef FD_SPAD_USE_HANDHOLDING + +#define fd_spad_alloc_max fd_spad_alloc_max_debug +#define fd_spad_frame_lo fd_spad_frame_lo_debug +#define fd_spad_frame_hi fd_spad_frame_hi_debug +#define fd_spad_push fd_spad_push_debug +#define fd_spad_pop fd_spad_pop_debug +#define fd_spad_alloc fd_spad_alloc_debug +#define fd_spad_trim fd_spad_trim_debug +#define fd_spad_prepare fd_spad_prepare_debug +#define fd_spad_cancel fd_spad_cancel_debug +#define fd_spad_publish fd_spad_publish_debug + +#undef FD_SPAD_FRAME_BEGIN +#undef FD_SPAD_FRAME_END + +#define FD_SPAD_FRAME_BEGIN FD_SPAD_FRAME_BEGIN_DEBUG +#define FD_SPAD_FRAME_END FD_SPAD_FRAME_END_DEBUG + +#endif /* FD_SPAD_USE_HANDHOLDING */ + + /* fd_valloc virtual function table for spad */ extern const fd_valloc_vtable_t fd_spad_vtable;