diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-05-31 15:02:31 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2013-05-31 15:02:31 +1000 |
commit | 0ffee6c5f2a16538363878974f541a69102e00ac (patch) | |
tree | 59b12f38f4f45196d818500aee484215a8366a0f /src/meta | |
parent | 756d8c6422953b70e1463255418d491267733f72 (diff) | |
download | mongo-0ffee6c5f2a16538363878974f541a69102e00ac.tar.gz |
imported patch realloc_def
Diffstat (limited to 'src/meta')
-rw-r--r-- | src/meta/meta_ckpt.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c index 22b620dbd7f..251fa5ade87 100644 --- a/src/meta/meta_ckpt.c +++ b/src/meta/meta_ckpt.c @@ -270,9 +270,8 @@ __wt_meta_ckptlist_get( if (__wt_config_getones(session, config, "checkpoint", &v) == 0 && __wt_config_subinit(session, &ckptconf, &v) == 0) for (; __wt_config_next(&ckptconf, &k, &v) == 0; ++slot) { - if (slot * sizeof(WT_CKPT) == allocated) - WT_ERR(__wt_realloc(session, &allocated, - (slot + 50) * sizeof(WT_CKPT), &ckptbase)); + WT_ERR(__wt_realloc_def( + session, &allocated, slot + 1, &ckptbase)); ckpt = &ckptbase[slot]; WT_ERR(__ckpt_load(session, &k, &v, ckpt)); @@ -288,9 +287,7 @@ __wt_meta_ckptlist_get( * checkpoint). All of that cooperation is handled in the WT_CKPT * structure referenced from the WT_BTREE structure. */ - if ((slot + 2) * sizeof(WT_CKPT) > allocated) - WT_ERR(__wt_realloc(session, &allocated, - (slot + 2) * sizeof(WT_CKPT), &ckptbase)); + WT_ERR(__wt_realloc_def(session, &allocated, slot + 2, &ckptbase)); /* Sort in creation-order. */ qsort(ckptbase, slot, sizeof(WT_CKPT), __ckpt_compare_order); |