GCC Middle and Back End API Reference
ggc-internal.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ggc_statistics
 

Functions

void ggc_mark_roots (void)
 
void ggc_mark_stringpool (void)
 
void ggc_purge_stringpool (void)
 
void gt_pch_save_stringpool (void)
 
void gt_pch_fixup_stringpool (void)
 
void gt_pch_restore_stringpool (void)
 
void gt_pch_p_S (void *, void *, gt_pointer_operator, void *)
 
struct ggc_pch_datainit_ggc_pch (void)
 
void ggc_pch_count_object (struct ggc_pch_data *, void *, size_t)
 
size_t ggc_pch_total_size (struct ggc_pch_data *)
 
void ggc_pch_this_base (struct ggc_pch_data *, void *)
 
char * ggc_pch_alloc_object (struct ggc_pch_data *, void *, size_t)
 
void ggc_pch_prepare_write (struct ggc_pch_data *, FILE *)
 
void ggc_pch_write_object (struct ggc_pch_data *, FILE *, void *, void *, size_t)
 
void ggc_pch_finish (struct ggc_pch_data *, FILE *)
 
void ggc_pch_read (FILE *, void *)
 
void ggc_record_overhead (size_t, size_t, void *FINAL_MEM_STAT_DECL)
 
void ggc_free_overhead (void *)
 
void ggc_prune_overhead_list (void)
 
size_t ggc_get_size (const void *)
 
void ggc_print_common_statistics (FILE *, ggc_statistics *)
 

Function Documentation

◆ ggc_free_overhead()

void ggc_free_overhead ( void * ptr)
extern
Notice that the pointer has been freed.   

References ggc_mem_desc.

Referenced by ggc_free().

◆ ggc_get_size()

size_t ggc_get_size ( const void * p)
extern
Return the number of bytes allocated at the indicated address.   
Return the size of the gc-able object P.   

References lookup_page_table_entry(), OBJECT_SIZE, and page_entry::order.

Referenced by ggc_realloc(), and gt_pch_note_object().

◆ ggc_mark_roots()

void ggc_mark_roots ( void )
extern
Garbage collection for the GNU compiler.  Internal definitions
   for ggc-*.c and stringpool.cc.

   Copyright (C) 2009-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
Call ggc_set_mark on all the roots.   
Iterate through all registered roots and mark each element.   

References ggc_root_tab::base, extra_root_vec, FOR_EACH_VEC_ELT, ggc_mark_root_tab(), ggc_mark_stringpool(), ggc_protect_identifiers, ggc_purge_stringpool(), gt_clear_caches(), gt_ggc_deletable_rtab, gt_ggc_rtab, i, invoke_plugin_callbacks(), ggc_root_tab::nelt, NULL, and ggc_root_tab::stride.

Referenced by ggc_collect().

◆ ggc_mark_stringpool()

void ggc_mark_stringpool ( void )
extern
Stringpool.   
Mark the entries in the string pool.   
Mark the trees hanging off the identifier node for GGC.  These are
handled specially (not using gengtype) because identifiers are only
roots during one part of compilation.   

References ident_hash, ident_hash_extra, mark_ident(), and NULL.

Referenced by ggc_mark_roots().

◆ ggc_pch_alloc_object()

char * ggc_pch_alloc_object ( struct ggc_pch_data * d,
void * x,
size_t size )
extern
Assuming that the objects really do end up at the address
passed to ggc_pch_this_base, return the address of this object.   

References ggc_pch_data::d, NUM_SIZE_LOOKUP, OBJECT_SIZE, and size_lookup.

Referenced by ggc_call_alloc().

◆ ggc_pch_count_object()

void ggc_pch_count_object ( struct ggc_pch_data * d,
void * x,
size_t size )
extern
The second parameter and third parameters give the address and size
of an object.  Update the ggc_pch_data structure with as much of
that information as is necessary.   

References ggc_pch_data::d, NUM_SIZE_LOOKUP, OBJECT_SIZE, size_lookup, and ggc_pch_ondisk::totals.

Referenced by ggc_call_count().

◆ ggc_pch_finish()

void ggc_pch_finish ( struct ggc_pch_data * d,
FILE * f )
extern
All objects have been written, write out any final information
required.   

References ggc_pch_data::d, fatal_error(), free(), and input_location.

Referenced by gt_pch_save().

◆ ggc_pch_prepare_write()

void ggc_pch_prepare_write ( struct ggc_pch_data * d,
FILE * f )
extern
Write out any initial information required.   

Referenced by gt_pch_save().

◆ ggc_pch_read()

◆ ggc_pch_this_base()

void ggc_pch_this_base ( struct ggc_pch_data * d,
void * base )
extern
The objects, when read, will most likely be at the address
in the second parameter.   

References a, ggc_pch_data::base, ggc_pch_data::d, i, NUM_ORDERS, OBJECT_SIZE, PAGE_ALIGN, and ggc_pch_ondisk::totals.

Referenced by gt_pch_save().

◆ ggc_pch_total_size()

size_t ggc_pch_total_size ( struct ggc_pch_data * d)
extern
Return the total size of the data to be written to hold all
the objects previously passed to ggc_pch_count_object.   

References a, ggc_pch_data::d, i, NUM_ORDERS, OBJECT_SIZE, PAGE_ALIGN, and ggc_pch_ondisk::totals.

Referenced by gt_pch_save().

◆ ggc_pch_write_object()

void ggc_pch_write_object ( struct ggc_pch_data * d,
FILE * f,
void * x,
void * newx,
size_t size )
extern

◆ ggc_print_common_statistics()

void ggc_print_common_statistics ( FILE * stream,
ggc_statistics * stats )
extern
Used by the various collectors to gather and print statistics that
do not depend on the collector in use.   

References ggc_stats, NULL, and stats.

Referenced by ggc_print_statistics().

◆ ggc_prune_overhead_list()

void ggc_prune_overhead_list ( void )
extern
After live values has been marked, walk all recorded pointers and see if
they are still live.   

References hash_map< KeyId, Value, Traits >::begin(), ggc_marked_p(), and ggc_mem_desc.

Referenced by ggc_collect().

◆ ggc_purge_stringpool()

void ggc_purge_stringpool ( void )
extern
Purge the entries in the string pool.   
Purge the identifier hash of identifiers which are no longer
referenced.   

References ggc_marked_p(), ident_hash, ident_hash_extra, maybe_delete_ident(), and NULL.

Referenced by ggc_mark_roots().

◆ ggc_record_overhead()

void ggc_record_overhead ( size_t ,
size_t ,
void * FINAL_MEM_STAT_DECL )
extern
Allocation and collection.   

◆ gt_pch_fixup_stringpool()

void gt_pch_fixup_stringpool ( void )
extern
Return the stringpool to its state before gt_pch_save_stringpool
was called.   

Referenced by gt_pch_save().

◆ gt_pch_p_S()

void gt_pch_p_S ( void * obj,
void * x,
gt_pointer_operator op,
void * cookie )
extern
PCH and GGC handling for strings, mostly trivial.   
Pointer-walking routine for strings (not very interesting, since
strings don't contain pointers).   

References gcc_unreachable.

Referenced by gt_pch_n_S(), gt_pch_n_S2(), gt_pch_note_object(), gt_pch_note_reorder(), and gt_pch_save().

◆ gt_pch_restore_stringpool()

void gt_pch_restore_stringpool ( void )
extern
A PCH file has been restored, which loaded SPD; fill the real hash table
from SPD.   

Referenced by gt_pch_restore().

◆ gt_pch_save_stringpool()

void gt_pch_save_stringpool ( void )
extern

◆ init_ggc_pch()

struct ggc_pch_data * init_ggc_pch ( void )
extern
Return a new ggc_pch_data structure.   

Referenced by gt_pch_save().