GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | ggc_root_tab |
struct | ggc_cache_tab |
Typedefs | |
typedef void(* | gt_note_pointers )(void *, void *, gt_pointer_operator, void *) |
typedef void(* | gt_handle_reorder )(void *, void *, gt_pointer_operator, void *) |
typedef void(* | gt_pointer_walker )(void *) |
Functions | |
int | gt_pch_note_object (void *, void *, gt_note_pointers) |
void | gt_pch_note_reorder (void *, void *, gt_handle_reorder) |
int | ggc_set_mark (const void *) |
int | ggc_marked_p (const void *) |
void | gt_pch_n_S (const void *) |
void | gt_ggc_m_S (const void *) |
void | init_stringpool (void) |
void | init_ggc (void) |
void | gt_pch_save (FILE *f) |
void * | ggc_internal_alloc_stat (size_t MEM_STAT_DECL) ATTRIBUTE_MALLOC |
size_t | ggc_round_alloc_size (size_t requested_size) |
void * | ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL) ATTRIBUTE_MALLOC |
void * | ggc_realloc_stat (void *, size_t MEM_STAT_DECL) |
void | ggc_free (void *) |
void | dump_ggc_loc_statistics (bool) |
static void * | ggc_internal_vec_alloc_stat () |
static void * | ggc_internal_cleared_vec_alloc_stat () |
static void * | ggc_alloc_atomic_stat () |
void * | ggc_cleared_alloc_htab_ignore_args (size_t, size_t) ATTRIBUTE_MALLOC |
void * | ggc_cleared_alloc_ptr_array_two_args (size_t, size_t) ATTRIBUTE_MALLOC |
void * | ggc_splay_alloc (int, void *) ATTRIBUTE_MALLOC |
void | ggc_splay_dont_free (void *, void *) |
const char * | ggc_alloc_string_stat (const char *contents, int length MEM_STAT_DECL) |
void | ggc_collect (void) |
void | ggc_register_root_tab (const struct ggc_root_tab *) |
void | ggc_register_cache_tab (const struct ggc_cache_tab *) |
void | gt_pch_restore (FILE *f) |
void | ggc_print_statistics (void) |
void | stringpool_statistics (void) |
void | init_ggc_heuristics (void) |
static struct rtx_def * | ggc_alloc_rtx_def_stat () |
static union tree_node * | ggc_alloc_tree_node_stat () |
static union tree_node * | ggc_alloc_cleared_tree_node_stat () |
static struct gimple_statement_base * | ggc_alloc_cleared_gimple_statement_stat () |
Variables | |
const char | empty_string [] |
struct ggc_root_tab *const | gt_ggc_rtab [] |
struct ggc_root_tab *const | gt_ggc_deletable_rtab [] |
struct ggc_root_tab *const | gt_pch_cache_rtab [] |
struct ggc_root_tab *const | gt_pch_scalar_rtab [] |
struct ggc_cache_tab *const | gt_ggc_cache_rtab [] |
bool | ggc_protect_identifiers |
typedef void(* gt_handle_reorder)(void *, void *, gt_pointer_operator, void *) |
One of these is called before objects are re-ordered in memory. The first parameter is the original object, the second is the subobject that has had its pointers reordered, the third parameter can compute the new values of a pointer when given the cookie in the fourth parameter.
typedef void(* gt_note_pointers)(void *, void *, gt_pointer_operator, void *) |
Internal functions and data structures used by the GTY machinery, including the generated gt*.[hc] files.
One of these applies its third parameter (with cookie in the fourth parameter) to each pointer in the object pointed to by the first parameter, using the second parameter.
typedef void(* gt_pointer_walker)(void *) |
Mark the object in the first parameter and anything it points to.
void dump_ggc_loc_statistics | ( | bool | ) |
|
inlinestatic |
References ggc_internal_alloc_stat().
Referenced by ggc_alloc_string_stat().
|
staticread |
References ggc_internal_cleared_alloc_stat().
Referenced by gimple_alloc_stat().
|
staticwrite |
References ggc_internal_cleared_alloc_stat().
Referenced by build_vl_exp_stat(), make_node_stat(), make_tree_vec_stat(), and make_vector_stat().
|
staticread |
Memory statistics passing versions of some allocators. Too few of them to make gengtype produce them, so just define the needed ones here.
References ggc_internal_alloc_stat().
Referenced by rtx_alloc_stat(), and shallow_copy_rtx_stat().
const char* ggc_alloc_string_stat | ( | const char * | contents, |
int length | MEM_STAT_DECL | ||
) |
Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS. If LENGTH is -1, then CONTENTS is assumed to be a null-terminated string and the memory sized accordingly.
|
staticwrite |
References ggc_internal_alloc_stat().
Referenced by build1_stat(), copy_node_stat(), make_tree_binfo_stat(), and tree_cons_stat().
void* ggc_cleared_alloc_htab_ignore_args | ( | size_t | , |
size_t | |||
) |
void* ggc_cleared_alloc_ptr_array_two_args | ( | size_t | , |
size_t | |||
) |
void ggc_collect | ( | void | ) |
Invoke the collector. Garbage collection occurs only when this function is called, not during allocations.
Top level mark-and-sweep routine.
References globals::allocated, globals::allocated_last_gc, clear_marks(), globals::context_depth, globals::context_depth_collections, globals::debug_file, G, ggc_force_collect, ggc_mark_roots(), ggc_prune_overhead_list(), invoke_plugin_callbacks(), poison_pages(), release_pages(), sweep_pages(), timevar_pop(), timevar_push(), and validate_free_objects().
Referenced by analyze_functions(), cgraph_finalize_function(), do_per_function(), do_per_function_toporder(), dump_ggc_loc_statistics(), execute_one_ipa_transform_pass(), execute_one_pass(), expand_function(), and ggc_print_common_statistics().
void ggc_free | ( | void * | ) |
Free a block. To be used when known for certain it's not reachable.
void* ggc_internal_alloc_stat | ( | size_t | MEM_STAT_DECL | ) |
Allocation.
The internal primitive.
void* ggc_internal_cleared_alloc_stat | ( | size_t | MEM_STAT_DECL | ) |
Allocates cleared memory.
|
inlinestatic |
References ggc_internal_cleared_alloc_stat().
Referenced by gimple_build_omp_for().
|
inlinestatic |
References ggc_internal_alloc_stat().
Referenced by gimple_copy().
int ggc_marked_p | ( | const void * | ) |
Return 1 if P has been marked, zero otherwise. P must have been allocated by the GC allocator; it mustn't point to static objects, stack variables, or memory allocated with malloc.
void ggc_print_statistics | ( | void | ) |
Statistics.
Print allocation statistics.
References globals::allocated, globals::allocated_last_gc, page_entry::bytes, globals::bytes_mapped, G, ggc_print_common_statistics(), HOST_LONG_LONG_FORMAT, memset(), page_entry::next, page_entry::num_free_objects, globals::pages, release_pages(), globals::stats, globals::total_allocated, globals::total_allocated_per_order, globals::total_allocated_under128, globals::total_allocated_under32, globals::total_allocated_under64, globals::total_overhead, globals::total_overhead_per_order, globals::total_overhead_under128, globals::total_overhead_under32, and globals::total_overhead_under64.
Referenced by dump_memory_report().
void* ggc_realloc_stat | ( | void * | , |
size_t | MEM_STAT_DECL | ||
) |
Resize a block.
void ggc_register_cache_tab | ( | const struct ggc_cache_tab * | ) |
Register an additional cache table. This can be useful for some plugins. Does nothing if the passed pointer is NULL.
void ggc_register_root_tab | ( | const struct ggc_root_tab * | ) |
Register an additional root table. This can be useful for some plugins. Does nothing if the passed pointer is NULL.
size_t ggc_round_alloc_size | ( | size_t | requested_size | ) |
int ggc_set_mark | ( | const void * | ) |
Actually set the mark on a particular region of memory, but don't follow pointers. This function is called by ggc_mark_*. It returns zero if the object was not previously marked; nonzero if the object was already marked, or if, for any other reason, pointers in this data structure should not be traversed.
void* ggc_splay_alloc | ( | int | , |
void * | |||
) |
void ggc_splay_dont_free | ( | void * | , |
void * | |||
) |
void gt_ggc_m_S | ( | const void * | ) |
void gt_pch_n_S | ( | const void * | ) |
PCH and GGC handling for strings, mostly trivial.
Referenced by gt_pch_nx().
int gt_pch_note_object | ( | void * | obj, |
void * | note_ptr_cookie, | ||
gt_note_pointers | note_ptr_fn | ||
) |
Used by the gt_pch_n_* routines. Register an object in the hash table.
Register an object in the hash table.
References hash_table< Descriptor, Allocator >::find_slot_with_hash(), ggc_get_size(), gt_pch_p_S(), ptr_data::note_ptr_cookie, ptr_data::note_ptr_fn, ptr_data::obj, and strlen().
Referenced by gt_pch_n_S(), and gt_pch_nx().
void gt_pch_note_reorder | ( | void * | obj, |
void * | note_ptr_cookie, | ||
gt_handle_reorder | reorder_fn | ||
) |
Used by the gt_pch_n_* routines. Register that an object has a reorder function.
Register an object in the hash table.
References hash_table< Descriptor, Allocator >::find_with_hash(), ptr_data::note_ptr_cookie, and ptr_data::reorder_fn.
void gt_pch_restore | ( | FILE * | f | ) |
Read objects previously saved with gt_pch_save from F.
void gt_pch_save | ( | FILE * | f | ) |
Write out all GCed objects to F.
void init_ggc | ( | void | ) |
Initialize the garbage collector.
Initialize the ggc-mmap allocator.
References alloc_anon(), globals::by_depth, globals::by_depth_in_use, globals::by_depth_max, page_entry::bytes, compute_inverse(), globals::debug_file, globals::depth, globals::depth_in_use, globals::depth_max, globals::dev_zero_fd, exact_log2(), extra_order_size_table, globals::free_pages, G, getpagesize(), internal_error(), globals::lg_pagesize, page_entry::next, order, page_entry::page, globals::pagesize, and globals::save_in_use.
Referenced by general_init().
void init_ggc_heuristics | ( | void | ) |
Heuristics.
References ggc_min_expand_heuristic(), ggc_min_heapsize_heuristic(), and set_default_param_value().
Referenced by general_init().
void init_stringpool | ( | void | ) |
End of GTY machinery API.
Initialize the string pool.
Initialize the string pool.
References alloc_node(), ident_hash, and stringpool_ggc_alloc().
Referenced by general_init().
void stringpool_statistics | ( | void | ) |
Report some basic statistics about the string pool.
References ident_hash.
Referenced by dump_memory_report().
const char empty_string[] |
Symbols are marked with `ggc' for `gcc gc' so as not to interfere with an external gc library that might be linked in.
Constants for general use.
@verbatim String pool for GCC.
Copyright (C) 2000-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/.
String text, identifier text and identifier node allocator. Identifiers are uniquely stored in a hash table. We use cpplib's hash table implementation. libiberty's hashtab.c is not used because it requires 100% average space overhead per string, which is unacceptable. Also, this algorithm is faster.
The "" allocated string.
Referenced by expand_asm_memory_barrier(), expand_asm_operands(), and ggc_alloc_string_stat().
bool ggc_protect_identifiers |
When true, identifier nodes are considered as GC roots. When false, identifier nodes are treated like any other GC-allocated object, and the identifier hash table is treated as a weak hash.
When true, protect the contents of the identifier hash table.
Referenced by compile_file(), do_compile(), and ggc_mark_roots().
struct ggc_cache_tab* const gt_ggc_cache_rtab[] |
Pointers to arrays of ggc_cache_tab, terminated by NULL.
Referenced by ggc_mark_roots().
struct ggc_root_tab* const gt_ggc_deletable_rtab[] |
Referenced by ggc_mark_roots(), and gt_pch_restore().
struct ggc_root_tab* const gt_ggc_rtab[] |
Pointers to arrays of ggc_root_tab, terminated by NULL.
Referenced by ggc_mark_roots(), gt_pch_restore(), and gt_pch_save().
struct ggc_root_tab* const gt_pch_cache_rtab[] |
Referenced by gt_pch_restore(), and gt_pch_save().
struct ggc_root_tab* const gt_pch_scalar_rtab[] |
Referenced by gt_pch_restore(), and gt_pch_save().