Commit 5b0a5102 authored by marko's avatar marko

branches/zip: Correct the Valgrind instrumentation of r2041.

Use UNIV_MEM_ASSERT_RW() instead of UNIV_MEM_VALID().  The latter
flags memory defined; the former checks that it is defined.
parent e00f417a
......@@ -679,8 +679,8 @@ page_zip_compress_node_ptrs(
/* Only leaf nodes may contain externally stored columns. */
ut_ad(!rec_offs_any_extern(offsets));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
/* Compress the extra bytes. */
......@@ -741,7 +741,8 @@ page_zip_compress_sec(
- c_stream->next_in;
if (UNIV_LIKELY(c_stream->avail_in)) {
UNIV_MEM_VALID(c_stream->next_in, c_stream->avail_in);
UNIV_MEM_ASSERT_RW(c_stream->next_in,
c_stream->avail_in);
err = deflate(c_stream, Z_NO_FLUSH);
if (UNIV_UNLIKELY(err != Z_OK)) {
break;
......@@ -782,8 +783,8 @@ page_zip_compress_clust_ext(
int err;
ulint i;
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
for (i = 0; i < rec_offs_n_fields(offsets); i++) {
......@@ -921,8 +922,8 @@ page_zip_compress_clust(
ULINT_UNDEFINED, &heap);
ut_ad(rec_offs_n_fields(offsets)
== dict_index_get_n_fields(index));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
/* Compress the extra bytes. */
......@@ -968,8 +969,8 @@ page_zip_compress_clust(
== rec_get_nth_field(rec, offsets,
trx_id_col + 1, &len));
ut_ad(len == DATA_ROLL_PTR_LEN);
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
/* Compress any preceding bytes. */
......@@ -1151,7 +1152,7 @@ page_zip_compress(
trx_id_col = ULINT_UNDEFINED;
}
UNIV_MEM_VALID(c_stream.next_in, c_stream.avail_in);
UNIV_MEM_ASSERT_RW(c_stream.next_in, c_stream.avail_in);
err = deflate(&c_stream, Z_FULL_FLUSH);
if (err != Z_OK) {
goto zlib_error;
......@@ -1202,7 +1203,7 @@ page_zip_compress(
- (c_stream.next_in - page);
ut_a(c_stream.avail_in <= UNIV_PAGE_SIZE - PAGE_ZIP_START - PAGE_DIR);
UNIV_MEM_VALID(c_stream.next_in, c_stream.avail_in);
UNIV_MEM_ASSERT_RW(c_stream.next_in, c_stream.avail_in);
err = deflate(&c_stream, Z_FINISH);
if (UNIV_UNLIKELY(err != Z_STREAM_END)) {
......@@ -2747,8 +2748,8 @@ page_zip_write_rec_ext(
ulint n_ext = rec_offs_n_extern(offsets);
ut_ad(rec_offs_validate(rec, index, offsets));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
externs -= (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN)
......@@ -2882,8 +2883,8 @@ page_zip_write_rec(
ut_ad(page_zip_header_cmp(page_zip, page));
ut_ad(page_simple_validate_new((page_t*) page));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
slot = page_zip_dir_find(page_zip, page_offset(rec));
......@@ -3135,8 +3136,8 @@ page_zip_write_blob_ptr(
ut_ad(page_is_leaf(page));
ut_ad(dict_index_is_clust(index));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
blob_no = page_zip_get_n_prev_extern(page_zip, rec, index)
......@@ -3375,8 +3376,8 @@ page_zip_write_trx_id_and_roll_ptr(
mach_write_to_7(field + DATA_TRX_ID_LEN, roll_ptr);
memcpy(storage, field, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
}
......@@ -3412,8 +3413,8 @@ page_zip_clear_rec(
heap_no = rec_get_heap_no_new(rec);
ut_ad(heap_no >= PAGE_HEAP_NO_USER_LOW);
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
if (
......@@ -3631,8 +3632,8 @@ page_zip_dir_delete(
ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(rec_offs_comp(offsets));
UNIV_MEM_VALID(rec, rec_offs_data_size(offsets));
UNIV_MEM_VALID(rec - rec_offs_extra_size(offsets),
UNIV_MEM_ASSERT_RW(rec, rec_offs_data_size(offsets));
UNIV_MEM_ASSERT_RW(rec - rec_offs_extra_size(offsets),
rec_offs_extra_size(offsets));
slot_rec = page_zip_dir_find(page_zip, page_offset(rec));
......
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