diff options
-rw-r--r-- | util/oslib-posix.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index f5c4016..d5dca47 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -88,6 +88,11 @@ void *qemu_oom_check(void *ptr) void *qemu_memalign(size_t alignment, size_t size) { void *ptr; + + if (alignment < sizeof(void*)) { + alignment = sizeof(void*); + } + #if defined(_POSIX_C_SOURCE) && !defined(__sun__) int ret; ret = posix_memalign(&ptr, alignment, size); |