mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
add some debugging code. addresses #1328
git-svn-id: file:///svn/toku/tokudb.1032b@8371 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
cff224eeb4
commit
71329202bb
2 changed files with 16 additions and 5 deletions
|
@ -4,7 +4,11 @@
|
|||
#include "includes.h"
|
||||
|
||||
// execute the cachetable callbacks using a writer thread 0->no 1->yes
|
||||
#if defined(_WIN32)
|
||||
#define DO_WRITER_THREAD 0
|
||||
#else
|
||||
#define DO_WRITER_THREAD 1
|
||||
#endif
|
||||
#if DO_WRITER_THREAD
|
||||
static void *cachetable_writer(void *);
|
||||
#endif
|
||||
|
|
|
@ -90,21 +90,28 @@ void memarena_close(MEMARENA *map) {
|
|||
*map = 0;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
void memarena_move_buffers(MEMARENA dest, MEMARENA source) {
|
||||
int i;
|
||||
char **other_bufs = dest->other_bufs;
|
||||
static int counter = 0;
|
||||
counter++;
|
||||
static int move_counter = 0;
|
||||
move_counter++;
|
||||
REALLOC_N(dest->n_other_bufs + source->n_other_bufs + 1, other_bufs);
|
||||
if (other_bufs == 0) {
|
||||
extern int toku_malloc_counter, toku_realloc_counter, toku_free_counter;
|
||||
#if defined(_WIN32)
|
||||
extern int _CrtCheckMemory(void);
|
||||
printf("_CrtCheckMemory:%d\n", _CrtCheckMemory());
|
||||
#endif
|
||||
printf("Z: counter:%d dest:%p %p %d source:%p %p %d errno:%d\n",
|
||||
counter,
|
||||
printf("Z: move_counter:%d dest:%p %p %d source:%p %p %d errno:%d\n",
|
||||
move_counter,
|
||||
dest, dest->other_bufs, dest->n_other_bufs,
|
||||
source, source->other_bufs, source->n_other_bufs,
|
||||
errno);
|
||||
printf("toku_memory_counters: %d %d %d\n", toku_malloc_counter, toku_realloc_counter, toku_free_counter);
|
||||
assert(other_bufs);
|
||||
}
|
||||
dest->other_bufs = other_bufs;
|
||||
|
|
Loading…
Add table
Reference in a new issue