diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-17 23:08:00 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-17 23:08:00 +0000 |
commit | 92f06184bb548e33327e5c9895b5d00f9e6d0304 (patch) | |
tree | 10dcc038bf8bcfb0dd6268ffbf36527b525bfb4e /libbacktrace/Makefile.am | |
parent | 16f97f36c2d368ed6618b8ac65958c0232187b55 (diff) | |
download | gcc-92f06184bb548e33327e5c9895b5d00f9e6d0304.tar.gz |
add finalizers to ggc
This implements finalizers by keeping a list of registered finalizers
and after every mark but before sweeping check to see if any of them are
for unmarked blocks.
gcc/ChangeLog:
* ggc-common.c (ggc_internal_cleared_alloc): Adjust.
* ggc-none.c (ggc_internal_alloc): Assert if a finalizer is passed.
(ggc_internal_cleared_alloc): Likewise.
* ggc-page.c (finalizer): New class.
(vec_finalizer): Likewise.
(globals::finalizers): New member.
(globals::vec_finalizers): Likewise.
(ggc_internal_alloc): Record the finalizer if any for the block being
allocated.
(ggc_handle_finalizers): New function.
(ggc_collect): Call ggc_handle_finalizers.
* ggc.h (ggc_internal_alloc): Add arguments to allow installing a
finalizer.
(ggc_internal_cleared_alloc): Likewise.
(finalize): New function.
(need_finalization_p): Likewise.
(ggc_alloc): Install the type's destructor as the finalizer if it
might do something.
(ggc_cleared_alloc): Likewise.
(ggc_vec_alloc): Likewise.
(ggc_cleared_vec_alloc): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210568 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libbacktrace/Makefile.am')
0 files changed, 0 insertions, 0 deletions