From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQNY7-0005gz-LL for qemu-devel@nongnu.org; Fri, 23 Jan 2009 10:02:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQNY6-0005gF-Qh for qemu-devel@nongnu.org; Fri, 23 Jan 2009 10:02:23 -0500 Received: from [199.232.76.173] (port=47495 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQNY6-0005g6-Mi for qemu-devel@nongnu.org; Fri, 23 Jan 2009 10:02:22 -0500 Received: from savannah.gnu.org ([199.232.41.3]:60330 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQNY6-0006z7-8e for qemu-devel@nongnu.org; Fri, 23 Jan 2009 10:02:22 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LQNY5-00076r-Q4 for qemu-devel@nongnu.org; Fri, 23 Jan 2009 15:02:21 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LQNY5-00076m-Fd for qemu-devel@nongnu.org; Fri, 23 Jan 2009 15:02:21 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Fri, 23 Jan 2009 15:02:21 +0000 Subject: [Qemu-devel] [6412] linux-user: add qemu_realloc() implementation to unbreak the build ( Gerd Hoffman) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6412 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6412 Author: aliguori Date: 2009-01-23 15:02:20 +0000 (Fri, 23 Jan 2009) Log Message: ----------- linux-user: add qemu_realloc() implementation to unbreak the build (Gerd Hoffman) Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/linux-user/mmap.c Modified: trunk/linux-user/mmap.c =================================================================== --- trunk/linux-user/mmap.c 2009-01-22 22:09:55 UTC (rev 6411) +++ trunk/linux-user/mmap.c 2009-01-23 15:02:20 UTC (rev 6412) @@ -123,6 +123,19 @@ 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) {