Commit c92d3f22 authored by Dave Wells's avatar Dave Wells Committed by Yoni Fogel

new assert macros

git-svn-id: file:///svn/toku/tokudb@20279 c7de825b-a66e-492c-adef-691d508d4ae1
parent 402dbc88
...@@ -57,6 +57,10 @@ extern "C" { ...@@ -57,6 +57,10 @@ extern "C" {
#endif #endif
#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; 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*)) { void brtloader_set_os_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FILE*)) {
os_fwrite_fun=fwrite_fun; os_fwrite_fun=fwrite_fun;
...@@ -287,7 +291,7 @@ static void brtloader_destroy (BRTLOADER bl, BOOL is_error) { ...@@ -287,7 +291,7 @@ static void brtloader_destroy (BRTLOADER bl, BOOL is_error) {
toku_free(bl->fs); toku_free(bl->fs);
for (int i=0; i<bl->N; i++) { 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_threads);
toku_free(bl->fractal_queues); toku_free(bl->fractal_queues);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment