Commit 826fe59e authored by marko's avatar marko

branches/zip: Improve Valgrind instrumentation of the file-based merge sort

in fast index creation.

row_merge_write_eof(), row_merge_buf_write(): When UNIV_DEBUG_VALGRIND
is defined, fill the rest of the block (after the end-of-block marker)
with 0xff.
parent b9982ac9
...@@ -437,7 +437,7 @@ row_merge_buf_write( ...@@ -437,7 +437,7 @@ row_merge_buf_write(
#ifdef UNIV_DEBUG_VALGRIND #ifdef UNIV_DEBUG_VALGRIND
/* The rest of the block is uninitialized. Initialize it /* The rest of the block is uninitialized. Initialize it
to avoid bogus warnings. */ to avoid bogus warnings. */
memset(b, 0, block[1] - b); memset(b, 0xff, block[1] - b);
#endif /* UNIV_DEBUG_VALGRIND */ #endif /* UNIV_DEBUG_VALGRIND */
} }
...@@ -776,7 +776,7 @@ row_merge_write_rec( ...@@ -776,7 +776,7 @@ row_merge_write_rec(
return(NULL); return(NULL);
} }
UNIV_MEM_ALLOC(block[0], sizeof block[0]); UNIV_MEM_INVALID(block[0], sizeof block[0]);
/* Copy the rest. */ /* Copy the rest. */
b = block[0]; b = block[0];
...@@ -811,13 +811,17 @@ row_merge_write_eof( ...@@ -811,13 +811,17 @@ row_merge_write_eof(
*b++ = 0; *b++ = 0;
UNIV_MEM_ASSERT_RW(block[0], b - block[0]); UNIV_MEM_ASSERT_RW(block[0], b - block[0]);
UNIV_MEM_ASSERT_W(block[0], sizeof block[0]); UNIV_MEM_ASSERT_W(block[0], sizeof block[0]);
UNIV_MEM_VALID(block[0], sizeof block[0]); #ifdef UNIV_DEBUG_VALGRIND
/* The rest of the block is uninitialized. Initialize it
to avoid bogus warnings. */
memset(b, 0xff, block[1] - b);
#endif /* UNIV_DEBUG_VALGRIND */
if (!row_merge_write(fd, (*foffs)++, block)) { if (!row_merge_write(fd, (*foffs)++, block)) {
return(NULL); return(NULL);
} }
UNIV_MEM_ALLOC(block[0], sizeof block[0]); UNIV_MEM_INVALID(block[0], sizeof block[0]);
return(block[0]); return(block[0]);
} }
...@@ -1024,7 +1028,7 @@ row_merge_read_clustered_index( ...@@ -1024,7 +1028,7 @@ row_merge_read_clustered_index(
goto func_exit; goto func_exit;
} }
UNIV_MEM_ALLOC(block[0], sizeof block[0]); UNIV_MEM_INVALID(block[0], sizeof block[0]);
merge_buf[i] = row_merge_buf_empty(buf); merge_buf[i] = row_merge_buf_empty(buf);
} }
...@@ -1218,7 +1222,7 @@ row_merge( ...@@ -1218,7 +1222,7 @@ row_merge(
return(DB_CORRUPTION); return(DB_CORRUPTION);
} }
UNIV_MEM_ALLOC(block[0], sizeof block[0]); UNIV_MEM_INVALID(block[0], sizeof block[0]);
} }
/* Swap file descriptors for the next pass. */ /* Swap file descriptors for the next pass. */
......
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