Commit 3a649a8a authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

After lots of hacking, the reressions are OK again

git-svn-id: file:///svn/tokudb@34 c7de825b-a66e-492c-adef-691d508d4ae1
parent 97246184
...@@ -560,6 +560,7 @@ static void test_read_what_was_written (void) { ...@@ -560,6 +560,7 @@ static void test_read_what_was_written (void) {
} }
r = close_brt(brt); assert(r==0); r = close_brt(brt); assert(r==0);
printf("%s:%d About to close %p\n", __FILE__, __LINE__, ct);
r = cachetable_close(ct); assert(r==0); r = cachetable_close(ct); assert(r==0);
memory_check_all_free(); memory_check_all_free();
...@@ -683,12 +684,12 @@ void test_cursor_next (void) { ...@@ -683,12 +684,12 @@ void test_cursor_next (void) {
} }
static void brt_blackbox_test (void) { static void brt_blackbox_test (void) {
test_read_what_was_written(); memory_check_all_free(); printf("did read_what_was_written\n");
test_cursor_next(); memory_check_all_free(); test_cursor_next(); memory_check_all_free();
test_multiple_dbs_many(); memory_check_all_free(); test_multiple_dbs_many(); memory_check_all_free();
test_cursor_last_empty(); memory_check_all_free(); test_cursor_last_empty(); memory_check_all_free();
test_multiple_brts_one_db_one_file(); memory_check_all_free(); test_multiple_brts_one_db_one_file(); memory_check_all_free();
test_dump_empty_db(); memory_check_all_free(); test_dump_empty_db(); memory_check_all_free();
test_read_what_was_written();
test_named_db(); test_named_db();
memory_check_all_free(); memory_check_all_free();
test_multiple_dbs(); test_multiple_dbs();
......
...@@ -1066,11 +1066,11 @@ int close_brt (BRT brt) { ...@@ -1066,11 +1066,11 @@ int close_brt (BRT brt) {
if (r!=0) return r; if (r!=0) return r;
} }
assert(0==cachefile_count_pinned(brt->cf, 1)); assert(0==cachefile_count_pinned(brt->cf, 1));
//printf("%s:%d closing cachetable\n", __FILE__, __LINE__); printf("%s:%d closing cachetable\n", __FILE__, __LINE__);
if ((r = cachefile_close(brt->cf))!=0) return r; if ((r = cachefile_close(brt->cf))!=0) return r;
if (brt->database_name) toku_free(brt->database_name); if (brt->database_name) toku_free(brt->database_name);
free(brt->skey); if (brt->skey) { toku_free(brt->skey); }
free(brt->sval); if (brt->sval) { toku_free(brt->sval); }
toku_free(brt); toku_free(brt);
return 0; return 0;
} }
......
...@@ -52,7 +52,7 @@ struct cachefile { ...@@ -52,7 +52,7 @@ struct cachefile {
}; };
int create_cachetable (CACHETABLE *result, int n_entries) { int create_cachetable (CACHETABLE *result, int n_entries) {
CACHETABLE MALLOC(t); TAGMALLOC(CACHETABLE, t);
int i; int i;
t->n_in_table = 0; t->n_in_table = 0;
t->table_size = n_entries; t->table_size = n_entries;
......
...@@ -19,12 +19,14 @@ static void *items[items_limit]; ...@@ -19,12 +19,14 @@ static void *items[items_limit];
static long sizes[items_limit]; static long sizes[items_limit];
void note_did_malloc (void *p, long size) { void note_did_malloc (void *p, long size) {
static long long count=0;
WHEN_MEM_DEBUG( WHEN_MEM_DEBUG(
if (n_items_malloced<items_limit) { items[n_items_malloced]=p; sizes[n_items_malloced]=size; } if (n_items_malloced<items_limit) { items[n_items_malloced]=p; sizes[n_items_malloced]=size; }
else overflowed=1; else overflowed=1;
//printf("%s:%d %p=malloc(%ld)\n", __FILE__, __LINE__, p, size); //printf("%s:%d %p=malloc(%ld)\n", __FILE__, __LINE__, p, size);
); );
n_items_malloced++; n_items_malloced++;
count++;
} }
void note_did_free(void *p) { void note_did_free(void *p) {
......
...@@ -34,11 +34,13 @@ int ybt_set_value (DBT *ybt, bytevec val, ITEMLEN vallen, void **staticptrp) { ...@@ -34,11 +34,13 @@ int ybt_set_value (DBT *ybt, bytevec val, ITEMLEN vallen, void **staticptrp) {
} else { } else {
if (staticptrp==0) return -1; if (staticptrp==0) return -1;
void *staticptr=*staticptrp; void *staticptr=*staticptrp;
//void *old=staticptr;
if (staticptr==0) if (staticptr==0)
staticptr = toku_malloc(vallen); staticptr = toku_malloc(vallen);
else else
staticptr = toku_realloc(staticptr, vallen); staticptr = toku_realloc(staticptr, vallen);
if (errno!=0) return errno; if (errno!=0) return errno;
//if (old!=staticptr) printf("%s:%d MALLOC --> %p\n", __FILE__, __LINE__, staticptr);
*staticptrp = staticptr; *staticptrp = staticptr;
ybt->data = staticptr; ybt->data = staticptr;
ybt->ulen = vallen; ybt->ulen = vallen;
......
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