summaryrefslogtreecommitdiff
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
commitee2a51080019653466837e2df59d4b6418f461ad (patch)
treeef36c582e3567543bed0f8d81c5622d2f4e8052a /oslib-win32.c
parent081b9ee42e39a3b93ec574461502d8c2844977c2 (diff)
downloadqemu-ee2a51080019653466837e2df59d4b6418f461ad.tar.gz
qemu-ee2a51080019653466837e2df59d4b6418f461ad.tar.bz2
qemu-ee2a51080019653466837e2df59d4b6418f461ad.zip
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 e03c47294d..ab29eae45c 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;
}