From: Junjie Mao <junjie.mao@intel.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
<qemu-devel@nongnu.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-Andr é Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daud é" <philmd@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Gustavo Romero" <gustavo.romero@linaro.org>,
"Alex Benn é e" <alex.bennee@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Zhao Liu" <zhao1.liu@intel.com>
Subject: Re: [PATCH v8 6/8] rust: add crate to expose bindings and interfaces
Date: Mon, 26 Aug 2024 15:45:26 +0800 [thread overview]
Message-ID: <d0dde1fc-574f-4920-96d7-86549f6ad1ce@intel.com> (raw)
In-Reply-To: <itc2k.22cnsecjnvt9@linaro.org>
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#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.
I attempted to look for alternatives in older glibs, but unfortunately didn't
find any.
---
Best Regards
Junjie Mao
>
> Manos
next prev parent reply other threads:[~2024-08-26 7:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 8:11 [PATCH v8 0/8] Add Rust build support, ARM PL011 device impl Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 1/8] Require meson version 1.5.0 Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 2/8] build-sys: Add rust feature option Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 3/8] configure, meson: detect Rust toolchain Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 4/8] rust: add bindgen step as a meson dependency Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 5/8] .gitattributes: add Rust diff and merge attributes Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 6/8] rust: add crate to expose bindings and interfaces Manos Pitsidianakis
2024-08-26 5:03 ` Junjie Mao
2024-08-26 6:12 ` Manos Pitsidianakis
2024-08-26 8:41 ` Junjie Mao
2024-08-26 5:31 ` Junjie Mao
2024-08-26 6:41 ` Manos Pitsidianakis
2024-08-26 7:45 ` Junjie Mao [this message]
2024-08-26 8:24 ` Thomas Huth
2024-08-26 11:29 ` Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 7/8] rust: add utility procedural macro crate Manos Pitsidianakis
2024-08-26 5:15 ` Junjie Mao
2024-08-26 6:02 ` Manos Pitsidianakis
2024-08-23 8:11 ` [PATCH v8 8/8] rust: add PL011 device model Manos Pitsidianakis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d0dde1fc-574f-4920-96d7-86549f6ad1ce@intel.com \
--to=junjie.mao@intel.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=gustavo.romero@linaro.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).