On Wed, 2013-09-04 at 14:14 +0200, Jan Kratochvil wrote:
Currently you call getlocation->__libdw_intern_expression for
every range in
the location list, even if that range does not contain our PC. That is both
CPU expensive and it also "leaks" memory (until cu->dbg gets destroyed)
even
more than formerly (formerly only one range got "leaked" on each
dwarf_getlocation call).
My idea was more to create dwarf_getlocations_internal without its last
getlocation call, use that from refactored dwarf_getlocation and create
current public dwarf_getlocations as a wrapper around
dwarf_getlocations_internal with that getlocation call.
Good point, I missed that. It is always good to do less work if at all
possible. I implemented it slightly differently from your suggestion,
but I believe it addresses your point. See new patch attached.
Thanks,
Mark