qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfa


From: Paolo Bonzini
Subject: Re: [PATCH RESEND v9 7/9] rust: add crate to expose bindings and interfaces
Date: Wed, 4 Sep 2024 13:01:45 +0200

On Wed, Aug 28, 2024 at 6:12 AM Manos Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:
>
> Add rust/qemu-api, which exposes rust-bindgen generated FFI bindings and
> provides some declaration macros for symbols visible to the rest of
> QEMU.

The only comment I have is that I would drop the allocator support
completely. It adds complications and, at least initially, we can
plan/hope that all cross-language allocations go through a constructor
function like error_setg() or object_new().

In the case of QOM, if we wanted to allocate objects in a Box rather
than malloc-ed memory, we could also put in the object a free function
that calls

   mem::drop(Box::from_raw(p))

Fixing rust.bindgen() to use the right CLANG_PATH/LIBCLANG_PATH should
probably be done in meson itself. The (not too hard) alternative is to
just use a custom_target.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]