Commit 842353e4 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

try to solve 1328. addresses #1328

git-svn-id: file:///svn/toku/tokudb.1032b@8366 c7de825b-a66e-492c-adef-691d508d4ae1
parent af745edb
......@@ -93,9 +93,15 @@ void memarena_close(MEMARENA *map) {
void memarena_move_buffers(MEMARENA dest, MEMARENA source) {
int i;
char **other_bufs = dest->other_bufs;
static int counter = 0;
counter++;
REALLOC_N(dest->n_other_bufs + source->n_other_bufs + 1, other_bufs);
if (other_bufs == 0) {
printf("Z: dest:%p %p %d source:%p %p %d errno:%d\n",
#if defined(_WIN32)
extern int _CrtCheckMemory(void);
#endif
printf("Z: counter:%d dest:%p %p %d source:%p %p %d errno:%d\n",
counter,
dest, dest->other_bufs, dest->n_other_bufs,
source, source->other_bufs, source->n_other_bufs,
errno);
......
......@@ -12,11 +12,18 @@
int toku_memory_check=0;
int toku_calloc_counter = 0;
int toku_malloc_counter = 0;
int toku_realloc_counter = 0;
int toku_free_counter = 0;
void *toku_calloc(size_t nmemb, size_t size) {
toku_calloc_counter++;
return calloc(nmemb, size);
}
void *toku_malloc(size_t size) {
toku_malloc_counter++;
return malloc(size);
}
......@@ -36,15 +43,17 @@ void *toku_tagmalloc(size_t size, enum typ_tag typtag) {
}
void *toku_realloc(void *p, size_t size) {
toku_realloc_counter++;
return realloc(p, size);
}
void toku_free(void* p) {
toku_free_counter++;
free(p);
}
void toku_free_n(void* p, size_t size __attribute__((unused))) {
free(p);
toku_free(p);
}
void *toku_memdup (const void *v, size_t len) {
......
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