aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/io.h
diff options
context:
space:
mode:
authorTrevor Saunders <tsaunders@mozilla.com>2014-05-17 23:08:00 +0000
committerTrevor Saunders <tbsaunde@gcc.gnu.org>2014-05-17 23:08:00 +0000
commitde49ce19cc37f620ee42caabda56f71bcb350887 (patch)
tree10dcc038bf8bcfb0dd6268ffbf36527b525bfb4e /libgfortran/io/io.h
parent04eec9877832c7cbb0ed270f700db8e5e3f25c93 (diff)
downloadgcc-de49ce19cc37f620ee42caabda56f71bcb350887.zip
gcc-de49ce19cc37f620ee42caabda56f71bcb350887.tar.gz
gcc-de49ce19cc37f620ee42caabda56f71bcb350887.tar.bz2
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. From-SVN: r210568
Diffstat (limited to 'libgfortran/io/io.h')
0 files changed, 0 insertions, 0 deletions