diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-07-16 00:07:21 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-07-16 00:07:21 +1000 |
commit | 551b48e3ac533996b99252873b2a0d5a7dae7b86 (patch) | |
tree | f7c973eebbc52f54736675e37714f5ca654c159e /src/include/cell.i | |
parent | 20b852a79c64bdc657669fd4b99c4cebba5ffbd6 (diff) | |
download | mongo-551b48e3ac533996b99252873b2a0d5a7dae7b86.tar.gz |
Bump the size of cells to cope with large keys, use the integer packing code in "unsafe" mode.
Diffstat (limited to 'src/include/cell.i')
-rw-r--r-- | src/include/cell.i | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/cell.i b/src/include/cell.i index 94e83046035..0580257fdc3 100644 --- a/src/include/cell.i +++ b/src/include/cell.i @@ -94,9 +94,10 @@ struct __wt_cell { * Maximum of 6 bytes: * 0: descriptor/type * 1: prefix compression - * 2-5: data-length + * 2-6: data-length + * (variable-length encoding of a uint32_t can go to 5 bytes). */ - uint8_t __chunk[6]; + uint8_t __chunk[7]; }; /* @@ -183,8 +184,8 @@ __wt_cell_pack(WT_SESSION_IMPL *session, if (type == WT_CELL_KEY) /* Prefix byte */ *p++ = (uint8_t)prefix; - /* Pack the data length. */ - (void)__wt_vpack_uint(&p, sizeof(cell->__chunk) - 1, (uint64_t)size); + /* Pack the data length: a cell is always big enough. */ + (void)__wt_vpack_uint(&p, 0, (uint64_t)size); *cell_lenp = WT_PTRDIFF32(p, cell); } |