mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
[t:3218] Try running the test if there is enough memory. Refs #3218.
git-svn-id: file:///svn/toku/tokudb@28261 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
93ae78dced
commit
88a608bc2f
1 changed files with 17 additions and 11 deletions
|
@ -102,17 +102,23 @@ test_merge_n_m (u_int64_t n, u_int64_t m, int mode)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_big_merge (void) {
|
test_big_merge (void) {
|
||||||
u_int64_t twoG = 1024LL * 1024LL * 1024LL * 2;
|
u_int64_t G = 1024LL * 1024LL * 1024LL;
|
||||||
u_int64_t an = twoG;
|
if (toku_os_get_phys_memory_size() < 40 * G) {
|
||||||
u_int64_t bn = 1;
|
fprintf(stderr, "Skipping big merge because there is only %4.1fG physical memory\n", toku_os_get_phys_memory_size()/(1024.0*1024.0*1024.0));
|
||||||
struct block_allocator_blockpair *MALLOC_N(an+bn, a);
|
} else {
|
||||||
struct block_allocator_blockpair *MALLOC_N(bn, b);
|
u_int64_t twoG = 2*G;
|
||||||
for (u_int64_t i=0; i<an; i++) a[i].offset=i+1;
|
|
||||||
b[0].offset = 0;
|
u_int64_t an = twoG;
|
||||||
block_allocator_merge_blockpairs_into(an, a, bn, b);
|
u_int64_t bn = 1;
|
||||||
for (u_int64_t i=0; i<an+bn; i++) assert(a[i].offset=i);
|
struct block_allocator_blockpair *MALLOC_N(an+bn, a);
|
||||||
toku_free(a);
|
struct block_allocator_blockpair *MALLOC_N(bn, b);
|
||||||
toku_free(b);
|
for (u_int64_t i=0; i<an; i++) a[i].offset=i+1;
|
||||||
|
b[0].offset = 0;
|
||||||
|
block_allocator_merge_blockpairs_into(an, a, bn, b);
|
||||||
|
for (u_int64_t i=0; i<an+bn; i++) assert(a[i].offset=i);
|
||||||
|
toku_free(a);
|
||||||
|
toku_free(b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
|
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue