Fix GNU coding style.

2018-11-05  Martin Liska  <mliska@suse.cz>

	* mem-stats.h (mem_alloc_description::get_list): Fix GNU coding
	style.
	* vec.c: Likewise.

From-SVN: r265798
This commit is contained in:
Martin Liska 2018-11-05 14:35:38 +01:00 committed by Martin Liska
parent 46aeb07ff8
commit 93ef36dc69
3 changed files with 32 additions and 36 deletions

View File

@ -1,3 +1,9 @@
2018-11-05 Martin Liska <mliska@suse.cz>
* mem-stats.h (mem_alloc_description::get_list): Fix GNU coding
style.
* vec.c: Likewise.
2018-11-05 Richard Biener <rguenther@suse.de>
* tree-scalar-evolution.h (final_value_replacement_loop): Update

View File

@ -294,9 +294,9 @@ public:
static bool
equal (value_type l1, value_type l2)
{
return l1->m_filename == l2->m_filename
return (l1->m_filename == l2->m_filename
&& l1->m_function == l2->m_function
&& l1->m_line == l2->m_line;
&& l1->m_line == l2->m_line);
}
};
@ -313,59 +313,50 @@ public:
~mem_alloc_description ();
/* Returns true if instance PTR is registered by the memory description. */
bool
contains_descriptor_for_instance (const void *ptr);
bool contains_descriptor_for_instance (const void *ptr);
/* Return descriptor for instance PTR. */
T *
get_descriptor_for_instance (const void *ptr);
T * get_descriptor_for_instance (const void *ptr);
/* Register memory allocation descriptor for container PTR which is
described by a memory LOCATION. */
T *
register_descriptor (const void *ptr, mem_location *location);
T * register_descriptor (const void *ptr, mem_location *location);
/* 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. */
T *
register_descriptor (const void *ptr, mem_alloc_origin origin,
T * register_descriptor (const void *ptr, mem_alloc_origin origin,
bool ggc, const char *name, int line,
const char *function);
/* Register instance overhead identified by PTR pointer. Allocation takes
SIZE bytes. */
T *
register_instance_overhead (size_t size, const void *ptr);
T * register_instance_overhead (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. */
void
register_object_overhead (T *usage, size_t size, const void *ptr);
void register_object_overhead (T *usage, size_t size, const void *ptr);
/* Release PTR pointer of SIZE bytes. If REMOVE_FROM_MAP is set to true,
remove the instance from reverse map. */
void
release_instance_overhead (void *ptr, size_t size,
void release_instance_overhead (void *ptr, size_t size,
bool remove_from_map = false);
/* Release intance object identified by PTR pointer. */
void
release_object_overhead (void *ptr);
void release_object_overhead (void *ptr);
/* Get sum value for ORIGIN type of allocation for the descriptor. */
T
get_sum (mem_alloc_origin origin);
T get_sum (mem_alloc_origin origin);
/* Get all tracked instances registered by the description. Items
are filtered by ORIGIN type, LENGTH is return value where we register
the number of elements in the list. If we want to process custom order,
CMP comparator can be provided. */
mem_list_t *
get_list (mem_alloc_origin origin, unsigned *length,
int (*cmp) (const void *first, const void *second) = NULL);
mem_list_t * get_list (mem_alloc_origin origin, unsigned *length,
int (*cmp) (const void *first,
const void *second) = NULL);
/* Dump all tracked instances of type ORIGIN. If we want to process custom
order, CMP comparator can be provided. */
@ -391,7 +382,6 @@ private:
reverse_mem_map_t *m_reverse_map;
};
/* Returns true if instance PTR is registered by the memory description. */
template <class T>
@ -410,9 +400,9 @@ mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr)
return m_reverse_map->get (ptr) ? (*m_reverse_map->get (ptr)).usage : NULL;
}
/* Register memory allocation descriptor for container PTR which is
described by a memory LOCATION. */
template <class T>
inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr,
@ -584,7 +574,8 @@ template <class T>
inline
typename mem_alloc_description<T>::mem_list_t *
mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length,
int (*cmp) (const void *first, const void *second))
int (*cmp) (const void *first,
const void *second))
{
/* vec data structure is not used because all vectors generate memory
allocation info a it would create a cycle. */

View File

@ -141,7 +141,6 @@ vec_prefix::release_overhead (void *ptr, size_t size, bool in_dtor
vec_mem_desc.release_instance_overhead (ptr, size, in_dtor);
}
/* Calculate the number of slots to reserve a vector, making sure that
it is of at least DESIRED size by growing ALLOC exponentially. */