Commit fce76a76 authored by unknown's avatar unknown

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
parent a09ecb25
......@@ -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
......
......@@ -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
......
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