- Delete unused funciton realloc
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1776 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
26e32760f9
commit
624252450f
|
@ -4,7 +4,6 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
extern void *malloc(size_t size);
|
extern void *malloc(size_t size);
|
||||||
extern void *realloc(void *mem, size_t size);
|
|
||||||
void free(void *ptr);
|
void free(void *ptr);
|
||||||
|
|
||||||
/* Extensions to malloc... */
|
/* Extensions to malloc... */
|
||||||
|
|
|
@ -47,23 +47,6 @@ void *malloc(size_t size)
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *realloc(void *mem, size_t size)
|
|
||||||
{
|
|
||||||
void *new_mem;
|
|
||||||
|
|
||||||
if (mem == 0)
|
|
||||||
return malloc(size);
|
|
||||||
if (size == 0) {
|
|
||||||
free(mem);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
new_mem = malloc(size);
|
|
||||||
memcpy(new_mem, mem, size);
|
|
||||||
free(mem);
|
|
||||||
return new_mem;
|
|
||||||
}
|
|
||||||
|
|
||||||
void free(void *where)
|
void free(void *where)
|
||||||
{
|
{
|
||||||
/* Don't care */
|
/* Don't care */
|
||||||
|
|
Loading…
Reference in New Issue