GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | ggc_statistics |
Typedefs | |
typedef struct ggc_statistics | 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_data * | init_ggc_pch (void) |
void | ggc_pch_count_object (struct ggc_pch_data *, void *, size_t, bool) |
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, bool) |
void | ggc_pch_prepare_write (struct ggc_pch_data *, FILE *) |
void | ggc_pch_write_object (struct ggc_pch_data *, FILE *, void *, void *, size_t, bool) |
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 *) |
Variables | |
bool | ggc_force_collect |
typedef struct ggc_statistics ggc_statistics |
Statistics.
This structure contains the statistics common to all collectors. Particular collectors can extend this structure.
void ggc_free_overhead | ( | void * | ) |
size_t ggc_get_size | ( | const void * | ) |
Return the number of bytes allocated at the indicated address.
Referenced by ggc_realloc_stat(), and gt_pch_note_object().
void ggc_mark_roots | ( | void | ) |
Call ggc_set_mark on all the roots.
Iterate through all registered roots and mark each element.
References ggc_root_tab::base, ggc_mark_root_tab(), ggc_mark_stringpool(), ggc_protect_identifiers, ggc_purge_stringpool(), ggc_scan_cache_tab(), gt_ggc_cache_rtab, gt_ggc_deletable_rtab, gt_ggc_rtab, invoke_plugin_callbacks(), memset(), and ggc_root_tab::stride.
Referenced by ggc_collect().
void ggc_mark_stringpool | ( | void | ) |
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, and mark_ident().
Referenced by ggc_mark_roots().
char* ggc_pch_alloc_object | ( | struct ggc_pch_data * | , |
void * | , | ||
size_t | , | ||
bool | |||
) |
Assuming that the objects really do end up at the address passed to ggc_pch_this_base, return the address of this object. The bool argument should be true if the object is a string.
References ggc_pch_data::base, and order.
Referenced by ggc_call_alloc().
void ggc_pch_count_object | ( | struct ggc_pch_data * | , |
void * | , | ||
size_t | , | ||
bool | |||
) |
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. The bool argument should be true if the object is a string.
References ggc_pch_data::d, order, and ggc_pch_ondisk::totals.
Referenced by ggc_call_count().
void ggc_pch_finish | ( | struct ggc_pch_data * | , |
FILE * | |||
) |
All objects have been written, write out any final information required.
Referenced by gt_pch_save().
void ggc_pch_prepare_write | ( | struct ggc_pch_data * | , |
FILE * | |||
) |
Write out any initial information required.
Referenced by gt_pch_save().
void ggc_pch_read | ( | FILE * | , |
void * | |||
) |
A PCH file has just been read in at the address specified second parameter. Set up the GC implementation for the new objects.
Referenced by gt_pch_restore().
void ggc_pch_this_base | ( | struct ggc_pch_data * | , |
void * | |||
) |
The objects, when read, will most likely be at the address in the second parameter.
Referenced by gt_pch_save().
size_t ggc_pch_total_size | ( | struct ggc_pch_data * | ) |
Return the total size of the data to be written to hold all the objects previously passed to ggc_pch_count_object.
Referenced by gt_pch_save().
void ggc_pch_write_object | ( | struct ggc_pch_data * | , |
FILE * | , | ||
void * | , | ||
void * | , | ||
size_t | , | ||
bool | |||
) |
Write out this object, including any padding. The last argument should be true if the object is a string.
References ggc_pch_data::d, fatal_error(), G, order, globals::pagesize, ggc_pch_ondisk::totals, and ggc_pch_data::written.
Referenced by gt_pch_save().
void ggc_print_common_statistics | ( | FILE * | , |
ggc_statistics * | |||
) |
Used by the various collectors to gather and print statistics that do not depend on the collector in use.
References ggc_collect(), and stats.
Referenced by ggc_print_statistics().
void ggc_prune_overhead_list | ( | void | ) |
After live values has been marked, walk all recorded pointers and see if they are still live.
References ggc_prune_ptr(), and hash_table< Descriptor, Allocator >::traverse().
Referenced by ggc_collect().
void ggc_purge_stringpool | ( | void | ) |
Purge the entries in the string pool.
Purge the identifier hash of identifiers which are no longer referenced.
References ident_hash, and maybe_delete_ident().
Referenced by ggc_mark_roots().
void ggc_record_overhead | ( | size_t | , |
size_t | , | ||
void * | FINAL_MEM_STAT_DECL | ||
) |
void gt_pch_fixup_stringpool | ( | void | ) |
Return the stringpool to its state before gt_pch_save_stringpool was called.
Referenced by gt_pch_save().
void gt_pch_p_S | ( | void * | obj, |
void * | x, | ||
gt_pointer_operator | op, | ||
void * | cookie | ||
) |
PCH and GGC handling for strings, mostly trivial.
Pointer-walking routine for strings (not very interesting, since strings don't contain pointers).
Referenced by ggc_call_alloc(), ggc_call_count(), gt_pch_n_S(), gt_pch_note_object(), and gt_pch_save().
void gt_pch_restore_stringpool | ( | void | ) |
A PCH file has been restored, which loaded SPD; fill the real hash table from SPD.
References ident_hash, and spd.
Referenced by gt_pch_restore().
void gt_pch_save_stringpool | ( | void | ) |
Save and restore the string pool entries for PCH.
Save the stringpool data in SPD.
References ident_hash, and memcpy().
Referenced by gt_pch_save().
|
read |
Return a new ggc_pch_data structure.
Referenced by gt_pch_save().
bool ggc_force_collect |
Allocation and collection.
When set, ggc_collect will do collection.
@verbatim Simple garbage collection for the GNU compiler.
Copyright (C) 1999-2013 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/.
Generic garbage collection (GC) functions and data, not specific to any particular GC implementation.
When set, ggc_collect will do collection.
Referenced by dump_ggc_loc_statistics(), and ggc_collect().