diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 20:19:18 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 20:19:18 +0000 |
commit | 004c9ef410ec2f88552708cf1e01e91a91a143ed (patch) | |
tree | 6072c0f76295763b29c895fe6cb90985ecaa14c9 /bsd-user | |
parent | sh4: sh_pci. Register resouces both at A7 and P4. (diff) | |
download | qemu-kvm-004c9ef410ec2f88552708cf1e01e91a91a143ed.tar.gz qemu-kvm-004c9ef410ec2f88552708cf1e01e91a91a143ed.tar.bz2 qemu-kvm-004c9ef410ec2f88552708cf1e01e91a91a143ed.zip |
Fix bsd-user compile like r6412
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6434 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'bsd-user')
-rw-r--r-- | bsd-user/mmap.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 9c0a76a3a..66233abc1 100644 --- a/bsd-user/mmap.c +++ b/bsd-user/mmap.c @@ -122,6 +122,19 @@ void qemu_free(void *ptr) munmap(p, *p); } +void *qemu_realloc(void *ptr, size_t size) +{ + size_t old_size, copy; + void *new_ptr; + + old_size = *(size_t *)((char *)ptr - 16); + copy = old_size < size ? old_size : size; + new_ptr = qemu_malloc(size); + memcpy(new_ptr, ptr, copy); + qemu_free(ptr); + return new_ptr; +} + /* NOTE: all the constants are the HOST ones, but addresses are target. */ int target_mprotect(abi_ulong start, abi_ulong len, int prot) { |