This better be simplified like this, so only have 1 malloc() call that
applies to both branches.
void *realloc(void *old_ptr, size_t new_size)
{
struct nolibc_heap *heap;
void *ret;
ret = malloc(new_size);
if (__builtin_expect(!ret, 0))
return NULL;
if (!old_ptr)
return ret;
heap = container_of(old_ptr, struct nolibc_heap, user_p);
memcpy(ret, heap->user_p, heap->len);
munmap(heap, heap->len);
return ret;
}