On 2/4/19 2:22 AM, Andreas Schneider wrote:
If you want to change allocations anyway, you should really take a
look at
talloc [1]. talloc is a hierarchical, reference counted memory pool system
with destructors. If you free the top memory context all children will be
freed to. It is just fun working with it and memory leaks don't really happen
anymore. If you forget to free some memory it will be gone once the parent is
freed. Also you can print the memory allocation tree for inspection.
My observation while doing this has been that most allocations are
single blocks which I don't think would make talloc's benefits worth the
additional overhead we'd get in trade. That said, there are a handful
of spots where that _might_ be useful, although some of that could be
mitigated with carefully-written setup/teardown functions for the
structures.
Right now I'm trying to make the static analysis report shorter by
adding some safety and not making major changes to the way the existing
code works.
--Mark
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org