summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-06-01 22:52:34 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-06-01 22:52:34 +1000
commit7ad7248c3e85b47275ea9169841c7c850321a2fd (patch)
tree43c17d5adec385945ad9e40e976b19eb315ad81d
parentca02d5215fc3d7de72687f853c69cedaf3aae473 (diff)
downloadmongo-7ad7248c3e85b47275ea9169841c7c850321a2fd.tar.gz
Deal with extending the meta tracking array during a sub-transaction.
-rw-r--r--src/meta/meta_track.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/meta/meta_track.c b/src/meta/meta_track.c
index 6b6c3c685d7..a8918d25d7a 100644
--- a/src/meta/meta_track.c
+++ b/src/meta/meta_track.c
@@ -32,20 +32,26 @@ typedef struct __wt_meta_track {
static int
__meta_track_next(WT_SESSION_IMPL *session, WT_META_TRACK **trkp)
{
- size_t offset;
+ size_t offset, sub_off;
if (!WT_META_TRACKING(session))
session->meta_track_next = session->meta_track;
offset = WT_PTRDIFF(session->meta_track_next, session->meta_track);
+ if (session->meta_track_sub != NULL)
+ sub_off =
+ WT_PTRDIFF(session->meta_track_sub, session->meta_track);
if (offset == session->meta_track_alloc) {
WT_RET(__wt_realloc(session, &session->meta_track_alloc,
WT_MAX(2 * session->meta_track_alloc,
20 * sizeof(WT_META_TRACK)), &session->meta_track));
- /* Maintain the position in the new chunk of memory. */
+ /* Maintain positions in the new chunk of memory. */
session->meta_track_next =
(uint8_t *)session->meta_track + offset;
+ if (session->meta_track_sub != NULL)
+ session->meta_track_sub =
+ (uint8_t *)session->meta_track + sub_off;
}
WT_ASSERT(session, session->meta_track_next != NULL);