Index: configure.ac =================================================================== diff -u -rcd18d47f5e3a972323f00af2cb6a42c9dc9d1a54 -rfccf09e0f22cd91e00f937625d6510dcf35dbcd4 --- configure.ac (.../configure.ac) (revision cd18d47f5e3a972323f00af2cb6a42c9dc9d1a54) +++ configure.ac (.../configure.ac) (revision fccf09e0f22cd91e00f937625d6510dcf35dbcd4) @@ -57,7 +57,7 @@ [build nsf with memcount debug support (default: disabled)]), [enable_memcount=$enableval], [enable_memcount=no]) AC_ARG_ENABLE([development], - AS_HELP_STRING([--enable-development], + AS_HELP_STRING([--enable-development=yes|test], [build nsf with development support (intensive runtime checking, etc.; default: disabled)]), [enable_development=$enableval], [enable_development=no]) AC_ARG_ENABLE([assertions], @@ -197,6 +197,9 @@ if test "$enable_development" = yes; then AC_DEFINE([NSF_DEVELOPMENT], [1], [Are we building with development support?]) fi +if test "$enable_development" = full; then + AC_DEFINE([NSF_DEVELOPMENT_TEST], [1], [Are we building with development support and intesive testing?]) +fi if test "$enable_memcount" = yes; then AC_DEFINE([NSF_MEM_COUNT], [1], [Are we building with memcount support?]) Index: generic/nsf.c =================================================================== diff -u -r41e05440d57881136dac05fe1b02c5bd5897edea -rfccf09e0f22cd91e00f937625d6510dcf35dbcd4 --- generic/nsf.c (.../nsf.c) (revision 41e05440d57881136dac05fe1b02c5bd5897edea) +++ generic/nsf.c (.../nsf.c) (revision fccf09e0f22cd91e00f937625d6510dcf35dbcd4) @@ -5,7 +5,7 @@ * for supporting language-oriented programming. For details, see * http://next-scripting.org/. * - * Copyright (C) 1999-2016 Gustaf Neumann (a) (b) + * Copyright (C) 1999-2017 Gustaf Neumann (a) (b) * Copyright (C) 1999-2007 Uwe Zdun (a) (b) * Copyright (C) 2007-2008 Martin Matuska (b) * Copyright (C) 2010-2016 Stefan Sobernig (b) @@ -838,7 +838,7 @@ /*fprintf(stderr, "ParseContextRelease %p status %.6x %d elements\n", pcPtr, status, pcPtr->objc);*/ -#if !defined(NDEBUG) +#if defined(NSF_DEVELOPMENT_TEST) { /* * Perform a general consistency check: although the contents of the parse @@ -2597,7 +2597,7 @@ * *---------------------------------------------------------------------- */ -#if !defined(NDEBUG) +#if defined(NSF_DEVELOPMENT_TEST) static void ValidClassListTail(const char *what, NsfClasses *classListPtr) { NsfClasses *sl, *tail; @@ -2810,16 +2810,16 @@ return pl; } -#if defined(NDEBUG) -#define AssertOrderIsWhite(arg) -#else +#if defined(NSF_DEVELOPMENT_TEST) static void AssertOrderIsWhite(NsfClasses *order) { register NsfClasses *pc; for (pc = order; pc != NULL; pc = pc->nextPtr) { assert(pc->cl->color == WHITE); } } +#else +# define AssertOrderIsWhite(arg) #endif /* @@ -5938,7 +5938,8 @@ void Nsf_DeleteNamespace(Tcl_Interp *interp, Tcl_Namespace *nsPtr) { -#if !defined(NDEBUG) + +#if defined(NSF_DEVELOPMENT_TEST) int activationCount = 0; Tcl_CallFrame *f = (Tcl_CallFrame *)Tcl_Interp_framePtr(interp); @@ -6273,7 +6274,7 @@ return cmd; } -#if !defined(NDEBUG) +#if defined(NSF_DEVELOPMENT_TEST) /* *---------------------------------------------------------------------- * ReverseLookupCmdFromCmdTable -- @@ -6333,7 +6334,7 @@ *---------------------------------------------------------------------- */ -static NsfObject * GetHiddenObjectFromCmd(Tcl_Interp *interp, Tcl_Command cmdPtr) nonnull(1); +static NsfObject *GetHiddenObjectFromCmd(Tcl_Interp *interp, Tcl_Command cmdPtr) nonnull(1); static NsfObject * GetHiddenObjectFromCmd(Tcl_Interp *interp, Tcl_Command cmdPtr) { @@ -8361,7 +8362,7 @@ continue; } -#if !defined(NDEBUG) +#if defined(NSF_DEVELOPMENT_TEST) { /* * Make sure, we can still lookup the object; the object has to be still @@ -31440,7 +31441,7 @@ * physical destroy round, we can set the counter to an appropriate * value to ensure deletion. */ -#if defined(NSF_DEVELOPMENT) +#if defined(NSF_DEVELOPMENT_TEST) if (unlikely(object->refCount != 1)) { if (object->refCount > 1) { NsfLog(interp, NSF_LOG_WARN, "RefCount for obj %p %d (name %s) > 1", Index: generic/nsf.h =================================================================== diff -u -rb8ca306282c9a1000b1c93ffd97f7f4673953f65 -rfccf09e0f22cd91e00f937625d6510dcf35dbcd4 --- generic/nsf.h (.../nsf.h) (revision b8ca306282c9a1000b1c93ffd97f7f4673953f65) +++ generic/nsf.h (.../nsf.h) (revision fccf09e0f22cd91e00f937625d6510dcf35dbcd4) @@ -191,6 +191,10 @@ # define NSF_DTRACE_METHOD_RETURN_PROBE(cscPtr,retCode) {} #endif +#if defined(NSF_DEVELOPMENT_FULL) && !defined(NSF_DEVELOPMENT) +# define NSF_DEVELOPMENT 1 +#endif + #ifdef NSF_DEVELOPMENT /* * The activation counts checking is best performed via the MEM_COUNT