Garbage Collector interface - GTY

Josef Zlomek zlomj9am@artax.karlin.mff.cuni.cz
Sun Feb 23 12:02:00 GMT 2003


> >>So its better to split the array of structures to 2 arrays, right?
> >>GTY machinery would be used for one of them (the main one),
> >>the second (auxiliary) one will not be marked.
> >
> >I doubt it.  Why can't the whole array be in GCed memory?
> >
> 
> It is, actually, and i'm confused what Josef thinks is wrong.
> 
> Josef, it does generate *markers* for the struct definition, they just 
> are never *used* anywhere.
> 
> It uses the right markers for the table:
> 
> static void gt_ggc_ma_decl_loc_table PARAMS ((void *));
> static void
> gt_ggc_ma_decl_loc_table (x_p)
>       void *x_p ATTRIBUTE_UNUSED;
> {
>   if (decl_loc_table != NULL) {
>     size_t i0;
>     ggc_mark (decl_loc_table);
>     for (i0 = 0; i0 < (size_t)(decl_loc_table_allocated); i0++) {
>       gt_ggc_m_12var_loc_node (decl_loc_table[i0].first);
>       gt_ggc_m_12var_loc_node (decl_loc_table[i0].last);
>     }
>   }
> }

I see. Thanks for explaining :-) I apologize I took your time.
I was confused by the following, but now I have found out that it really is not
used anywhere.

void
gt_ggc_mx_var_loc_list_def (x_p)
      void *x_p;
{
  struct var_loc_list_def * const x = (struct var_loc_list_def *)x_p;
  if (ggc_test_and_set_mark (x))
    {
      gt_ggc_m_12var_loc_node ((*x).first);
    }
}

Josef



More information about the Gcc mailing list