[Rpm-maint] [rpm-software-management/rpm] Add API for clone rpmps iterator (func rpmpsiClone) (#1359)

Panu Matilainen notifications at github.com
Fri Sep 18 07:14:47 UTC 2020

This is actually a text-book example of operator overloading considered harmful.

Assuming this was added and a wrapper uses it for post-increment operator: we've managed to turn what is essentially an integer increment at the fooNext() rpm API into malloc, assign, increment reference (possibly taking additional locks while doing so), free and decrement reference (again possible taking additional locks), which is not only slow but also harmful in that it's an invitation for memory fragmentation. And since all that mumbo-jumbo is masqueraded into a deceptively simple ++ instead of some next() call, guess which one people are going to use?

If it can't be sanely implemented, it's better not to offer the choice.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200918/7396be31/attachment.html>

More information about the Rpm-maint mailing list