Commit 94f7b7f3 authored by unknown's avatar unknown

mem0mem.c:

  Add more diagnostic code to cath possible memory corruption


innobase/mem/mem0mem.c:
  Add more diagnostic code to cath possible memory corruption
parent a1940f03
...@@ -119,6 +119,10 @@ mem_heap_create_block( ...@@ -119,6 +119,10 @@ mem_heap_create_block(
ut_ad((type == MEM_HEAP_DYNAMIC) || (type == MEM_HEAP_BUFFER) ut_ad((type == MEM_HEAP_DYNAMIC) || (type == MEM_HEAP_BUFFER)
|| (type == MEM_HEAP_BUFFER + MEM_HEAP_BTR_SEARCH)); || (type == MEM_HEAP_BUFFER + MEM_HEAP_BTR_SEARCH));
if (heap && heap->magic_n != MEM_BLOCK_MAGIC_N) {
mem_analyze_corruption((byte*)heap);
}
/* In dynamic allocation, calculate the size: block header + data. */ /* In dynamic allocation, calculate the size: block header + data. */
if (init_block != NULL) { if (init_block != NULL) {
...@@ -251,6 +255,10 @@ mem_heap_block_free( ...@@ -251,6 +255,10 @@ mem_heap_block_free(
ulint len; ulint len;
ibool init_block; ibool init_block;
if (block->magic_n != MEM_BLOCK_MAGIC_N) {
mem_analyze_corruption((byte*)block);
}
UT_LIST_REMOVE(list, heap->base, block); UT_LIST_REMOVE(list, heap->base, block);
type = heap->type; type = heap->type;
......
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