diff options
Diffstat (limited to 'util/oslib-win32.c')
-rw-r--r-- | util/oslib-win32.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/util/oslib-win32.c b/util/oslib-win32.c index ee3a369..af559ef 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -58,7 +58,11 @@ void *qemu_try_memalign(size_t alignment, size_t size) void *ptr; g_assert(size != 0); - g_assert(is_power_of_2(alignment)); + if (alignment < sizeof(void *)) { + alignment = sizeof(void *); + } else { + g_assert(is_power_of_2(alignment)); + } ptr = _aligned_malloc(size, alignment); trace_qemu_memalign(alignment, size, ptr); return ptr; |