mirror of https://github.com/xemu-project/xemu.git
w32: Make qemu_vfree() accept NULL like the POSIX implementation
On POSIX, qemu_vfree() accepts NULL, because it's merely wrapper around free(). As far as I can tell, the Windows implementation doesn't. Breeds bugs that bite only under Windows. Make the Windows implementation behave like the POSIX implementation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
f700f8e346
commit
94c8ff3a01
|
@ -71,7 +71,9 @@ void *qemu_vmalloc(size_t size)
|
||||||
void qemu_vfree(void *ptr)
|
void qemu_vfree(void *ptr)
|
||||||
{
|
{
|
||||||
trace_qemu_vfree(ptr);
|
trace_qemu_vfree(ptr);
|
||||||
VirtualFree(ptr, 0, MEM_RELEASE);
|
if (ptr) {
|
||||||
|
VirtualFree(ptr, 0, MEM_RELEASE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: add proper locking */
|
/* FIXME: add proper locking */
|
||||||
|
|
Loading…
Reference in New Issue