]> gcc.gnu.org Git - gcc.git/commitdiff
ctfc: Free CTF container elements in ctfc_delete_container ()
authorIndu Bhagat <indu.bhagat@oracle.com>
Thu, 7 Oct 2021 19:24:33 +0000 (12:24 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Thu, 7 Oct 2021 19:39:19 +0000 (12:39 -0700)
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.

gcc/ctfc.c

index 73c118e3d49432bae4379d14ae631202bd02bedd..b76277f38748963d2a132a20a318c03a3a44f8f7 100644 (file)
@@ -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)
This page took 0.062713 seconds and 5 git commands to generate.