|
| From: | Junjie Mao |
| Subject: | Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces |
| Date: | Mon, 26 Aug 2024 15:45:26 +0800 |
| User-agent: | Mozilla Thunderbird |
On 8/26/2024 2:41 PM, Manos Pitsidianakis wrote:
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#L509Hm. 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.
I attempted to look for alternatives in older glibs, but unfortunately didn't find any.
--- Best Regards Junjie Mao
Manos
| [Prev in Thread] | Current Thread | [Next in Thread] |