Commit c8f0dbb1 authored by marko's avatar marko

branches/zip: Correct the Valgrind instrumentation that was added in r1947.

parent ac57f924
......@@ -921,17 +921,23 @@ page_cur_insert_rec_low(
/* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets);
/* The whole record must be writeable. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_W(rec_get_start(rec, offsets), rec_size);
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_get_start(rec, offsets),
rec_offs_extra_size(offsets)
- rec_offs_comp(offsets)
#ifdef UNIV_DEBUG_VALGRIND
{
const void* rec_start
= rec - rec_offs_extra_size(offsets);
ulint extra_size
= rec_offs_extra_size(offsets)
- (rec_offs_comp(offsets)
? REC_N_NEW_EXTRA_BYTES
: REC_N_OLD_EXTRA_BYTES);
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_start, extra_size);
}
#endif /* UNIV_DEBUG_VALGRIND */
/* 2. Try to find suitable space from page memory management */
free_rec = page_header_get_ptr(page, PAGE_FREE);
......@@ -1187,17 +1193,23 @@ page_cur_insert_rec_zip(
/* 1. Get the size of the physical record in the page */
rec_size = rec_offs_size(offsets);
/* The whole record must be writeable. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_W(rec_get_start(rec, offsets), rec_size);
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_get_start(rec, offsets),
rec_offs_extra_size(offsets)
- rec_offs_comp(offsets)
#ifdef UNIV_DEBUG_VALGRIND
{
const void* rec_start
= rec - rec_offs_extra_size(offsets);
ulint extra_size
= rec_offs_extra_size(offsets)
- (rec_offs_comp(offsets)
? REC_N_NEW_EXTRA_BYTES
: REC_N_OLD_EXTRA_BYTES);
/* All data bytes of the record must be valid. */
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
/* The variable-length header must be valid. */
UNIV_MEM_ASSERT_RW(rec_start, extra_size);
}
#endif /* UNIV_DEBUG_VALGRIND */
/* 2. Try to find suitable space from page memory management */
if (!page_zip_available(page_zip, dict_index_is_clust(index),
rec_size, 1)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment