Commit fce76a76 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -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
+0 −29
Original line number Diff line number Diff line
@@ -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