aboutsummaryrefslogtreecommitdiff
path: root/oslib-win32.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2010-10-26 10:39:26 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-10-30 08:02:39 +0000
commitb152aa84d52882bb1846485a89baf13aa07c86bc (patch)
treeef36c582e3567543bed0f8d81c5622d2f4e8052a /oslib-win32.c
parentbc4a957c46acd8f4b2f2ffe6b2f90512325924dd (diff)
downloadqemu-b152aa84d52882bb1846485a89baf13aa07c86bc.zip
qemu-b152aa84d52882bb1846485a89baf13aa07c86bc.tar.gz
qemu-b152aa84d52882bb1846485a89baf13aa07c86bc.tar.bz2
Consolidate oom_check() functions
This consolidates the duplicated oom_check() functions, as well as splitting them into OS dependant versions to avoid the #ifdef grossness that was present in the old osdep.c version. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'oslib-win32.c')
-rw-r--r--oslib-win32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/oslib-win32.c b/oslib-win32.c
index e03c472..ab29eae 100644
--- a/oslib-win32.c
+++ b/oslib-win32.c
@@ -31,7 +31,7 @@
#include "trace.h"
#include "qemu_socket.h"
-static void *oom_check(void *ptr)
+void *qemu_oom_check(void *ptr)
{
if (ptr == NULL) {
fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError());
@@ -47,7 +47,7 @@ void *qemu_memalign(size_t alignment, size_t size)
if (!size) {
abort();
}
- ptr = oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
+ ptr = qemu_oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
trace_qemu_memalign(alignment, size, ptr);
return ptr;
}
@@ -62,7 +62,7 @@ void *qemu_vmalloc(size_t size)
if (!size) {
abort();
}
- ptr = oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
+ ptr = qemu_oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
trace_qemu_vmalloc(size, ptr);
return ptr;
}