GCC Middle and Back End API Reference
|
#include <mem-stats.h>
Data Structures | |
struct | mem_location_hash |
Public Types | |
typedef hash_map< mem_location_hash, T * > | mem_map_t |
typedef hash_map< const void *, mem_usage_pair< T > > | reverse_mem_map_t |
typedef hash_map< const void *, std::pair< T *, size_t > > | reverse_object_map_t |
typedef std::pair< mem_location *, T * > | mem_list_t |
Public Member Functions | |
mem_alloc_description () | |
~mem_alloc_description () | |
bool | contains_descriptor_for_instance (const void *ptr) |
T * | get_descriptor_for_instance (const void *ptr) |
T * | register_descriptor (const void *ptr, mem_location *location) |
T * | register_descriptor (const void *ptr, mem_alloc_origin origin, bool ggc, const char *name, int line, const char *function) |
T * | register_instance_overhead (size_t size, const void *ptr) |
void | register_object_overhead (T *usage, size_t size, const void *ptr) |
T * | release_instance_overhead (void *ptr, size_t size, bool remove_from_map=false) |
void | release_object_overhead (void *ptr) |
void | unregister_descriptor (void *ptr) |
T | get_sum (mem_alloc_origin origin) |
mem_list_t * | get_list (mem_alloc_origin origin, unsigned *length) |
void | dump (mem_alloc_origin origin) |
Data Fields | |
reverse_object_map_t * | m_reverse_object_map |
Private Member Functions | |
T * | register_overhead (size_t size, mem_alloc_origin origin, const char *name, int line, const char *function, const void *ptr) |
Private Attributes | |
mem_location | m_location |
mem_map_t * | m_map |
reverse_mem_map_t * | m_reverse_map |
Memory allocation description.
std::pair<mem_location *, T *> mem_alloc_description< T >::mem_list_t |
hash_map<mem_location_hash, T *> mem_alloc_description< T >::mem_map_t |
hash_map<const void *, mem_usage_pair<T> > mem_alloc_description< T >::reverse_mem_map_t |
hash_map<const void *, std::pair<T *, size_t> > mem_alloc_description< T >::reverse_object_map_t |
|
inline |
Default contructor.
|
inline |
Default destructor.
|
inline |
Returns true if instance PTR is registered by the memory description.
References hash_map< KeyId, Value, Traits >::get().
|
inline |
Dump all tracked instances of type ORIGIN. If we want to process custom order, CMP comparator can be provided.
References mem_location::get_origin_name(), and i.
Referenced by dump_alloc_pool_statistics().
|
inline |
Return descriptor for instance PTR.
References NULL.
|
inline |
|
inline |
Get sum value for ORIGIN type of allocation for the descriptor.
References i.
|
inline |
Register memory allocation descriptor for container PTR. ORIGIN identifies type of container and GGC identifes if the allocation is handled in GGC memory. Each location is identified by file NAME, LINE in source code and FUNCTION name.
|
inline |
|
inline |
void mem_alloc_description< T >::register_object_overhead | ( | T * | usage, |
size_t | size, | ||
const void * | ptr ) |
For containers (and GGC) where we want to track every instance object, we register allocation of SIZE bytes, identified by PTR pointer, belonging to USAGE descriptor.
References usage().
|
inlineprivate |
Register overhead of SIZE bytes of ORIGIN type. PTR pointer is allocated in NAME source file, at LINE in source code, in FUNCTION.
References usage().
|
inline |
Release instance object identified by PTR pointer.
|
inline |
Unregister a memory allocation descriptor registered with register_descriptor (remove from reverse map), unless it is unregistered through release_instance_overhead with REMOVE_FROM_MAP = true.
|
private |
|
private |
|
private |
reverse_object_map_t* mem_alloc_description< T >::m_reverse_object_map |