On Mon, 26 Aug 2024 11:24, Thomas Huth <th...@redhat.com> wrote:
On 26/08/2024 08.41, Manos Pitsidianakis wrote:
On Mon, 26 Aug 2024 08:31, Junjie Mao <junjie....@intel.com> wrote:
+unsafe impl GlobalAlloc for QemuAllocator {
+    unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
+        if layout.align() == 0 {
+            g_malloc0(layout.size().try_into().unwrap()).cast::<u8>()
+        } else {
+            g_aligned_alloc0(

One more thing: g_aligned_alloc0() was introduced in glib 2.72 [1] but the current glib version check in meson is >= 2.66.0.

Glib 2.72 still supports Win 7+, so no increase to _WIN32_WINNT is needed for this version bumping.

[1] https://docs.gtk.org/glib/func.aligned_alloc0.html
[2] https://gitlab.gnome.org/GNOME/glib/-/blob/2.72.0/meson.build?ref_type=tags#L509

Hm. Was there no way to have aligned allocations before 2.72? We can emit a cfg from meson if glib is <2.72 and handle it differently.

Can't you simply use our qemu_memalign() function instead?

Thanks, that'd solve the problem.

Reply via email to