summaryrefslogtreecommitdiff
path: root/storage/innobase/mem
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2018-03-20 10:46:57 +0300
committerEugene Kosov <claprix@yandex.ru>2018-03-20 10:46:57 +0300
commit5a8f8f89d65b75e51048288a49c86a8d974a8543 (patch)
tree1f879a7c5d62094cb8bf91c020bba061cb03505b /storage/innobase/mem
parent75c76dbb06a99359d867e2a516f3244bf41fde96 (diff)
downloadmariadb-git-5a8f8f89d65b75e51048288a49c86a8d974a8543.tar.gz
honor alignment rules and xtradb too
Diffstat (limited to 'storage/innobase/mem')
-rw-r--r--storage/innobase/mem/mem0mem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c
index 31f235b1960..924231470aa 100644
--- a/storage/innobase/mem/mem0mem.c
+++ b/storage/innobase/mem/mem0mem.c
@@ -404,7 +404,10 @@ mem_heap_create_block(
heap->total_size += len;
}
- UNIV_MEM_FREE(block + 1, len - MEM_BLOCK_HEADER_SIZE);
+ /* Poison all available memory. Individual chunks will be unpoisoned on
+ every mem_heap_alloc() call. */
+ compile_time_assert(MEM_BLOCK_HEADER_SIZE >= sizeof *block);
+ UNIV_MEM_FREE(block + 1, len - sizeof *block);
ut_ad((ulint)MEM_BLOCK_HEADER_SIZE < len);