[Rpm-maint] [rpm-software-management/rpm] Avoid `n * m` memory allocation in base2bin() (Issue #1984)

Florian Festi notifications at github.com
Thu Jul 14 07:27:36 UTC 2022


Can you elaborate on what this ticket is about. base2bin returns an array of same size objects. So using n * m bytes of memory is not surprising. Are you suggesting to return a different data structure with different sizes returned for each entry? As far as I understand some argv style of data structure would be  useful but won't work here as the data may contain null bytes so we can't used null terminated strings. Is it really worth returning n size_t in addition to the pure data?

Also the wording about `hex2bin` is ambiguous. Does `hex2bin` need to be fixed, too? Or was it fixed and the same method should be applied here, too? If so I fail to see what that might be.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1984#issuecomment-1184094226
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/1984/1184094226 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220714/5665bd65/attachment.html>


More information about the Rpm-maint mailing list