Fix the undersized buffer pool problem. Fixes #632. Addresses #580.

git-svn-id: file:///svn/tokudb@3237 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Bradley C. Kuszmaul 2008-04-03 13:13:21 +00:00
parent 02e0667890
commit f293366ddc
2 changed files with 5 additions and 3 deletions

View file

@ -256,7 +256,7 @@ int malloc_diskblock (DISKOFF *res, BRT brt, int size, TOKULOGGER logger) {
}
u_int32_t mp_pool_size_for_nodesize (u_int32_t nodesize) {
#if 0
#if 1
return nodesize+nodesize/4;
#else
return nodesize;
@ -287,9 +287,10 @@ static void initialize_brtnode (BRT t, BRTNODE n, DISKOFF nodename, int height)
int r = toku_gpma_create(&n->u.l.buffer, 0);
assert(r==0);
{
void *mp = toku_malloc(n->nodesize);
u_int32_t mpsize = mp_pool_size_for_nodesize(n->nodesize);
void *mp = toku_malloc(mpsize);
assert(mp);
toku_mempool_init(&n->u.l.buffer_mempool, mp, mp_pool_size_for_nodesize(n->nodesize));
toku_mempool_init(&n->u.l.buffer_mempool, mp, mpsize);
}
static int rcount=0;

View file

@ -45,5 +45,6 @@ int main (int argc, const char *argv[]) {
verbose = 0;
}
test_overflow();
toku_malloc_cleanup();
return 0;
}