summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/mem0mem.ic
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/include/mem0mem.ic')
-rw-r--r--storage/xtradb/include/mem0mem.ic12
1 files changed, 4 insertions, 8 deletions
diff --git a/storage/xtradb/include/mem0mem.ic b/storage/xtradb/include/mem0mem.ic
index 63e68150b61..2b4638718fd 100644
--- a/storage/xtradb/include/mem0mem.ic
+++ b/storage/xtradb/include/mem0mem.ic
@@ -305,8 +305,8 @@ mem_heap_free_heap_top(
mem_block_set_free(block, old_top - (byte*) block);
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
- UNIV_MEM_ASSERT_W(old_top, (byte*) block + block->len - old_top);
#if defined UNIV_MEM_DEBUG
+ UNIV_MEM_ALLOC(old_top, (byte*)block + block->len - old_top);
/* In the debug version erase block from top up */
mem_erase_buf(old_top, (byte*) block + block->len - old_top);
@@ -315,7 +315,7 @@ mem_heap_free_heap_top(
mem_current_allocated_memory -= (total_size - size);
mutex_exit(&mem_hash_mutex);
#endif /* UNIV_MEM_DEBUG */
- UNIV_MEM_ALLOC(old_top, (byte*) block + block->len - old_top);
+ UNIV_MEM_FREE(old_top, (byte*)block + block->len - old_top);
/* If free == start, we may free the block if it is not the first
one */
@@ -396,11 +396,11 @@ mem_heap_free_top(
/* Subtract the free field of block */
mem_block_set_free(block, mem_block_get_free(block)
- MEM_SPACE_NEEDED(n));
- UNIV_MEM_ASSERT_W((byte*) block + mem_block_get_free(block), n);
#ifdef UNIV_MEM_DEBUG
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
+ UNIV_MEM_ALLOC((byte*) block + mem_block_get_free(block), n);
/* In the debug version check the consistency, and erase field */
mem_field_erase((byte*) block + mem_block_get_free(block), n);
#endif
@@ -412,11 +412,7 @@ mem_heap_free_top(
== mem_block_get_start(block))) {
mem_heap_block_free(heap, block);
} else {
- /* Avoid a bogus UNIV_MEM_ASSERT_W() warning in a
- subsequent invocation of mem_heap_free_top().
- Originally, this was UNIV_MEM_FREE(), to catch writes
- to freed memory. */
- UNIV_MEM_ALLOC((byte*) block + mem_block_get_free(block), n);
+ UNIV_MEM_FREE((byte*) block + mem_block_get_free(block), n);
}
}