From c92d3f22545a4fefe9008925a5ad7c911fae782a Mon Sep 17 00:00:00 2001 From: Dave Wells <wells@tokutek.com> Date: Mon, 17 May 2010 14:32:19 +0000 Subject: [PATCH] new assert macros git-svn-id: file:///svn/toku/tokudb@20279 c7de825b-a66e-492c-adef-691d508d4ae1 --- newbrt/brtloader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/newbrt/brtloader.c b/newbrt/brtloader.c index 81cf9527b37..9a784aa38fd 100644 --- a/newbrt/brtloader.c +++ b/newbrt/brtloader.c @@ -57,6 +57,10 @@ extern "C" { #endif #endif +#define lazy_assert(a) assert(a) // indicates code is incomplete +#define invariant(a) assert(a) // indicates a code invariant that must be true +#define resource_assert(a) assert(a) // indicates resource must be available, otherwise unrecoverable + static size_t (*os_fwrite_fun)(const void *,size_t,size_t,FILE*)=NULL; void brtloader_set_os_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) { os_fwrite_fun=fwrite_fun; @@ -287,7 +291,7 @@ static void brtloader_destroy (BRTLOADER bl, BOOL is_error) { toku_free(bl->fs); for (int i=0; i<bl->N; i++) { - assert(bl->fractal_queues[i]==NULL); // !!! If this isn't true, we may have to kill the pthreads and destroy the fractal trees. For now just barf. + lazy_assert(bl->fractal_queues[i]==NULL); // !!! If this isn't true, we may have to kill the pthreads and destroy the fractal trees. For now just barf. } toku_free(bl->fractal_threads); toku_free(bl->fractal_queues); -- 2.30.9