Skip to contentSkip to conversation

util/oslib-win32: Fix _aligned_malloc() arguments order

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Jan 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util/oslib-win32: Fix _aligned_malloc() arguments order

Commit dfbd0b873a8 inadvertently swapped the arguments of _aligned_malloc(), correct it to fix [*]:

G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests tests/test-qht.exe --tap -k
ERROR test-qht - too few tests run (expected 2, got 0)
make: *** [Makefile.mtest:256: run-test-30] Error 1

[*] https://cirrus-ci.com/task/6055645751279616?command=test#L593

Fixes dfbd0b873a8 ("util/oslib-win32: Use _aligned_malloc for qemu_try_memalign")
---
 util/oslib-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/oslib-win32.c +1 -1
index e6f83e10edb..f68b8012bb8 100644
@@ -59,7 +59,7 @@ void *qemu_try_memalign(size_t alignment, size_t size)
 
     g_assert(size != 0);
     g_assert(is_power_of_2(alignment));
-    ptr = _aligned_malloc(alignment, size);
+    ptr = _aligned_malloc(size, alignment);
     trace_qemu_memalign(alignment, size, ptr);
     return ptr;
 }
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Philippe Mathieu-Daudé

Commit dfbd0b873a8 inadvertently swapped the arguments of _aligned_malloc(), correct it to fix [*]:

G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests

Quoted 1 line

G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests

Quoted 7 lines

tests/test-qht.exe --tap -k
ERROR test-qht - too few tests run (expected 2, got 0)
make: *** [Makefile.mtest:256: run-test-30] Error 1

[*] https://cirrus-ci.com/task/6055645751279616?command=test#L593

Fixes dfbd0b873a8 ("util/oslib-win32: Use _aligned_malloc for

qemu_try_memalign")

Quoted 22 lines
---
 util/oslib-win32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/oslib-win32.c +1 -2
index e6f83e10edb..f68b8012bb8 100644
@@ -59,7 +59,7 @@ void *qemu_try_memalign(size_t alignment, size_t size)
 
     g_assert(size != 0);
     g_assert(is_power_of_2(alignment));
-    ptr = _aligned_malloc(alignment, size);
+    ptr = _aligned_malloc(size, alignment);
     trace_qemu_memalign(alignment, size, ptr);
     return ptr;
 }
--
Quoted 2 lines

2.26.2

Oh, sorry, you 've fixed this. ignore my patch

--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo