From 923e1f5e3d0e3006509ad025b040b5b965676f6c Mon Sep 17 00:00:00 2001 From: unknown <heikki@hundin.mysql.fi> Date: Wed, 16 Jun 2004 20:24:35 +0300 Subject: [PATCH] mem0mem.ic, mem0mem.h: Remove broken mem_realloc(); a patch to remove its uses in pars0lex.l and fil0fil.c will soon follow innobase/include/mem0mem.h: Remove broken mem_realloc(); a patch to remove its uses in pars0lex.l and fil0fil.c will soon follow innobase/include/mem0mem.ic: Remove broken mem_realloc(); a patch to remove its uses in pars0lex.l and fil0fil.c will soon follow --- innobase/include/mem0mem.h | 12 ------------ innobase/include/mem0mem.ic | 29 ----------------------------- 2 files changed, 41 deletions(-) diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index 89e2a337c99..2dc5a111173 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -260,18 +260,6 @@ mem_free_func( char* file_name, /* in: file name where created */ ulint line /* in: line where created */ ); -/******************************************************************* -Implements realloc. */ -UNIV_INLINE -void* -mem_realloc( -/*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - char* file_name,/* in: file name where called */ - ulint line); /* in: line where called */ - /************************************************************************** Duplicates a NUL-terminated string. */ UNIV_INLINE diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index a51de5a5cf0..7ae19d0f31c 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -563,35 +563,6 @@ mem_heap_get_size( return(size); } -/******************************************************************* -Implements realloc. */ -UNIV_INLINE -void* -mem_realloc( -/*========*/ - /* out, own: free storage, NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - 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); - buf = newbuf; - } - return(buf); -} - /************************************************************************** Duplicates a NUL-terminated string. */ UNIV_INLINE -- 2.30.9