added realloc

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1408 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Greg Watson 2004-03-13 03:40:03 +00:00
parent ef71326b8e
commit 54b1658202
1 changed files with 17 additions and 0 deletions

View File

@ -46,6 +46,23 @@ void *malloc(size_t size)
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)
{
/* Don't care */