Re: [PATCH 2/3] rust: implement wrapper for acpi_object

From: Gladyshev Ilya
Date: Fri Jan 09 2026 - 05:31:17 EST


On 1/8/26 23:06, Gary Guo wrote:
On Thu Jan 8, 2026 at 5:11 PM GMT, Gladyshev Ilya wrote:
On 1/8/26 16:21, Gary Guo wrote:
On Wed, 7 Jan 2026 23:35:32 +0300
Gladyshev Ilya <foxido@xxxxxxxxxx> wrote:

ACPI Object is represented via union on C-side. On Rust side, this union
is transparently wrapped for each ACPI Type, with individual methods and
Defer implementation to represented type (integer, string, buffer, etc).

Signed-off-by: Gladyshev Ilya <foxido@xxxxxxxxxx>


Hi Gladyshev,

I've checked the `acpi_object` implementation on the C side and it appears
that the buffer is not owned by the object (however managed externally,
could either be resting in ACPI tables directly or be allocated).
Hm, I looked through ACPI_FREE() call sites and acpi_evaluate_object()
implementation, and it seems to me that the acpi_object's lifetime is
the same as its internal buffer.

No, it's not the same. acpi_object's lifetime needs to be shorter than
the internal buffer.

Okay, I agree than) Will fix in next revision