mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Simplfy the logic a little. Addresses #880.
git-svn-id: file:///svn/tokudb@4256 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
8f6bbeb225
commit
d4a80654d1
1 changed files with 5 additions and 5 deletions
10
newbrt/brt.c
10
newbrt/brt.c
|
@ -3346,7 +3346,7 @@ static int omt_compress_kvspace (OMT omt, struct mempool *memp, size_t added_siz
|
|||
}
|
||||
void *newmem = toku_malloc(memp->size);
|
||||
if (newmem == 0)
|
||||
return -2;
|
||||
return ENOMEM;
|
||||
struct mempool new_kvspace;
|
||||
toku_mempool_init(&new_kvspace, newmem, memp->size);
|
||||
struct omt_compressor_state oc = { &new_kvspace, omt };
|
||||
|
@ -3361,10 +3361,10 @@ void *mempool_malloc_from_omt(OMT omt, struct mempool *mp, size_t size) {
|
|||
void *v = toku_mempool_malloc(mp, size, 1);
|
||||
if (v==0) {
|
||||
original_mp = *mp;
|
||||
if (0 == omt_compress_kvspace(omt, mp, size)) {
|
||||
v = toku_mempool_malloc(mp, size, 1);
|
||||
assert(v);
|
||||
}
|
||||
int r = omt_compress_kvspace(omt, mp, size);
|
||||
assert(r==0);
|
||||
v = toku_mempool_malloc(mp, size, 1);
|
||||
assert(v);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue