[Rpm-maint] [rpm-software-management/rpm] Rust bindings for rpmlib (#429)

Panu Matilainen notifications at github.com
Mon Apr 23 10:13:13 UTC 2018


> Alright, perhaps I can take a step back from the reference-based stuff and take a look at creating "owned" values... although my preferred way to do that in Rust would be for Rust to make a copy itself, as opposed to having rpm allocate the memory and me having to call rpm again to free it. That way Rust owns the memory and I can leverage Rust's built-in destructors.

Yup, that's more or less what the Python bindings do as well: the data is converted to native presentation right after headerGet(), and once that is done you can free any allocations done by rpm to return that data (eg string arrays and extensions always allocate something), the rest is managed by Python. See https://github.com/rpm-software-management/rpm/blob/05b233ddbe3a64089001b3d912c9a9080806953e/python/header-py.c#L464 and https://github.com/rpm-software-management/rpm/blob/master/python/rpmtd-py.c for the details.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/429#issuecomment-383525199
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180423/19d1b60f/attachment.html>


More information about the Rpm-maint mailing list