Blame 0018-use-memalign-instead-of-posix_memalign.patch
|
Justin M. Forbes |
a81953 |
From 898303cfd535d76ce971f3ac1310696937fbd286 Mon Sep 17 00:00:00 2001
|
|
Justin M. Forbes |
a81953 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Justin M. Forbes |
a81953 |
Date: Mon, 14 Jun 2010 09:53:48 +0200
|
|
Justin M. Forbes |
a81953 |
Subject: [PATCH 18/39] use memalign instead of posix_memalign
|
|
Justin M. Forbes |
a81953 |
|
|
Justin M. Forbes |
a81953 |
---
|
|
Justin M. Forbes |
a81953 |
osdep.c | 5 +++++
|
|
Justin M. Forbes |
a81953 |
1 files changed, 5 insertions(+), 0 deletions(-)
|
|
Justin M. Forbes |
a81953 |
|
|
Justin M. Forbes |
a81953 |
diff --git a/osdep.c b/osdep.c
|
|
Justin M. Forbes |
a81953 |
index 2375a69..ed2fd40 100644
|
|
Justin M. Forbes |
a81953 |
--- a/osdep.c
|
|
Justin M. Forbes |
a81953 |
+++ b/osdep.c
|
|
Justin M. Forbes |
a81953 |
@@ -100,7 +100,12 @@ void *qemu_memalign(size_t alignment, size_t size)
|
|
Justin M. Forbes |
a81953 |
#if defined(_POSIX_C_SOURCE) && !defined(__sun__)
|
|
Justin M. Forbes |
a81953 |
int ret;
|
|
Justin M. Forbes |
a81953 |
void *ptr;
|
|
Justin M. Forbes |
a81953 |
+#if 0
|
|
Justin M. Forbes |
a81953 |
ret = posix_memalign(&ptr, alignment, size);
|
|
Justin M. Forbes |
a81953 |
+#else
|
|
Justin M. Forbes |
a81953 |
+ ptr = memalign(alignment, size);
|
|
Justin M. Forbes |
a81953 |
+ ret = (ptr == NULL) ? -1 : 0;
|
|
Justin M. Forbes |
a81953 |
+#endif
|
|
Justin M. Forbes |
a81953 |
if (ret != 0) {
|
|
Justin M. Forbes |
a81953 |
fprintf(stderr, "Failed to allocate %zu B: %s\n",
|
|
Justin M. Forbes |
a81953 |
size, strerror(ret));
|
|
Justin M. Forbes |
a81953 |
--
|
|
Justin M. Forbes |
a81953 |
1.7.2.3
|
|
Justin M. Forbes |
a81953 |
|