Home GnuPG
Diffusion GnuPG 2739834206f2

Add code to allow for late memory cleanup.
2739834206f2Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Add code to allow for late memory cleanup.

* common/init.c (mem_cleanup_item_t): New.
(run_mem_cleanup): New.
(_init_common_subsystems): Add an atexit for it.
(register_mem_cleanup_func): New.
* g10/kbnode.c (cleanup_registered): New.
(release_unused_nodes): New.
(alloc_node): Call register_mem_cleanup_func.

It is often time consuming to figure out whether still allocated
memory at process termination is fine (e.g. a cache) or a problem. To
help for that register_mem_cleanup_func may now be used to cleanup
such memory. The run time of the program will be longer; if that
turns out to be a problem we can change the code to only run in
debugging mode.

Details

Provenance
wernerAuthored on Dec 28 2012, 7:26 PM
Parents
rG44159b681f8f: kbx: Remove unused macro.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG2739834206f2: Add code to allow for late memory cleanup. (authored by Werner Koch <wk@gnupg.org>).Mar 20 2013, 9:50 AM