|
From: | Manos Pitsidianakis |
Subject: | Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces |
Date: | Mon, 26 Aug 2024 09:41:58 +0300 |
User-agent: | meli 0.8.7 |
On Mon, 26 Aug 2024 08:31, Junjie Mao <junjie.mao@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.
Manos
[Prev in Thread] | Current Thread | [Next in Thread] |