Loading innobase/include/mem0mem.ic +15 −3 Original line number Diff line number Diff line Loading @@ -575,9 +575,21 @@ mem_realloc( char* file_name,/* in: file name where called */ ulint line) /* in: line where called */ { mem_heap_t* heap = (mem_heap_t*)((byte*)buf - MEM_BLOCK_HEADER_SIZE - MEM_FIELD_HEADER_SIZE); ulint size; ut_a(heap->magic_n == MEM_BLOCK_MAGIC_N); size = mem_block_get_len(heap); ut_a(size > MEM_BLOCK_HEADER_SIZE + MEM_FIELD_HEADER_SIZE); size -= MEM_BLOCK_HEADER_SIZE + MEM_FIELD_HEADER_SIZE; if (n > size) { void* newbuf = memcpy(mem_alloc_func(n, file_name, line), buf, size); mem_free(buf); return(mem_alloc_func(n, file_name, line)); buf = newbuf; } return(buf); } /************************************************************************** Loading Loading
innobase/include/mem0mem.ic +15 −3 Original line number Diff line number Diff line Loading @@ -575,9 +575,21 @@ mem_realloc( char* file_name,/* in: file name where called */ ulint line) /* in: line where called */ { mem_heap_t* heap = (mem_heap_t*)((byte*)buf - MEM_BLOCK_HEADER_SIZE - MEM_FIELD_HEADER_SIZE); ulint size; ut_a(heap->magic_n == MEM_BLOCK_MAGIC_N); size = mem_block_get_len(heap); ut_a(size > MEM_BLOCK_HEADER_SIZE + MEM_FIELD_HEADER_SIZE); size -= MEM_BLOCK_HEADER_SIZE + MEM_FIELD_HEADER_SIZE; if (n > size) { void* newbuf = memcpy(mem_alloc_func(n, file_name, line), buf, size); mem_free(buf); return(mem_alloc_func(n, file_name, line)); buf = newbuf; } return(buf); } /************************************************************************** Loading