diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2021-10-07 12:24:33 -0700 |
---|---|---|
committer | Indu Bhagat <indu.bhagat@oracle.com> | 2021-10-07 12:39:19 -0700 |
commit | 1848fbf0546abe2a7443e25a418eff7895a2ebb5 (patch) | |
tree | 67fb0cd4bfdaa6e6d5c42c6e0f682624bb732b34 | |
parent | ae2df1a347fad44fa70990311ca981698487b780 (diff) | |
download | gcc-1848fbf0546abe2a7443e25a418eff7895a2ebb5.zip gcc-1848fbf0546abe2a7443e25a418eff7895a2ebb5.tar.gz gcc-1848fbf0546abe2a7443e25a418eff7895a2ebb5.tar.bz2 |
ctfc: Free CTF container elements in ctfc_delete_container ()
Free up the memory held by hash tables containing CTF types and CTF variables
at the earliest. This can be done in ctfc_delete_container () as CTF debug
informtion has already been emitted.
gcc/ChangeLog:
* ctfc.c (ctfc_delete_container): Free hash table contents.
-rw-r--r-- | gcc/ctfc.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -944,11 +944,14 @@ ctfc_delete_strtab (ctf_strtable_t * strtab) void ctfc_delete_container (ctf_container_ref ctfc) { - /* FIXME - CTF container can be cleaned up now. - Will the ggc machinery take care of cleaning up the container structure - including the hash_map members etc. ? */ if (ctfc) { + ctfc->ctfc_types->empty (); + ctfc->ctfc_types = NULL; + + ctfc->ctfc_vars->empty (); + ctfc->ctfc_types = NULL; + ctfc_delete_strtab (&ctfc->ctfc_strtable); ctfc_delete_strtab (&ctfc->ctfc_aux_strtable); if (ctfc->ctfc_vars_list) |