Commit 93ef36dc by Martin Liska Committed by Martin Liska

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
parent 46aeb07f
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> 2018-11-05 Richard Biener <rguenther@suse.de>
* tree-scalar-evolution.h (final_value_replacement_loop): Update * tree-scalar-evolution.h (final_value_replacement_loop): Update
...@@ -282,21 +282,21 @@ public: ...@@ -282,21 +282,21 @@ public:
static hashval_t static hashval_t
hash (value_type l) hash (value_type l)
{ {
inchash::hash hstate; inchash::hash hstate;
hstate.add_ptr ((const void *)l->m_filename); hstate.add_ptr ((const void *)l->m_filename);
hstate.add_ptr (l->m_function); hstate.add_ptr (l->m_function);
hstate.add_int (l->m_line); hstate.add_int (l->m_line);
return hstate.end (); return hstate.end ();
} }
static bool static bool
equal (value_type l1, value_type l2) 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_function == l2->m_function
&& l1->m_line == l2->m_line; && l1->m_line == l2->m_line);
} }
}; };
...@@ -313,59 +313,50 @@ public: ...@@ -313,59 +313,50 @@ public:
~mem_alloc_description (); ~mem_alloc_description ();
/* Returns true if instance PTR is registered by the memory description. */ /* Returns true if instance PTR is registered by the memory description. */
bool bool contains_descriptor_for_instance (const void *ptr);
contains_descriptor_for_instance (const void *ptr);
/* Return descriptor for instance PTR. */ /* Return descriptor for instance PTR. */
T * T * get_descriptor_for_instance (const void *ptr);
get_descriptor_for_instance (const void *ptr);
/* Register memory allocation descriptor for container PTR which is /* Register memory allocation descriptor for container PTR which is
described by a memory LOCATION. */ described by a memory LOCATION. */
T * T * register_descriptor (const void *ptr, mem_location *location);
register_descriptor (const void *ptr, mem_location *location);
/* Register memory allocation descriptor for container PTR. ORIGIN identifies /* Register memory allocation descriptor for container PTR. ORIGIN identifies
type of container and GGC identifes if the allocation is handled in GGC 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 memory. Each location is identified by file NAME, LINE in source code and
FUNCTION name. */ FUNCTION name. */
T * T * register_descriptor (const void *ptr, mem_alloc_origin origin,
register_descriptor (const void *ptr, mem_alloc_origin origin, bool ggc, const char *name, int line,
bool ggc, const char *name, int line, const char *function);
const char *function);
/* Register instance overhead identified by PTR pointer. Allocation takes /* Register instance overhead identified by PTR pointer. Allocation takes
SIZE bytes. */ SIZE bytes. */
T * T * register_instance_overhead (size_t size, const void *ptr);
register_instance_overhead (size_t size, const void *ptr);
/* For containers (and GGC) where we want to track every instance object, /* For containers (and GGC) where we want to track every instance object,
we register allocation of SIZE bytes, identified by PTR pointer, belonging we register allocation of SIZE bytes, identified by PTR pointer, belonging
to USAGE descriptor. */ to USAGE descriptor. */
void void register_object_overhead (T *usage, size_t size, const void *ptr);
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, /* Release PTR pointer of SIZE bytes. If REMOVE_FROM_MAP is set to true,
remove the instance from reverse map. */ remove the instance from reverse map. */
void void release_instance_overhead (void *ptr, size_t size,
release_instance_overhead (void *ptr, size_t size,
bool remove_from_map = false); bool remove_from_map = false);
/* Release intance object identified by PTR pointer. */ /* Release intance object identified by PTR pointer. */
void void release_object_overhead (void *ptr);
release_object_overhead (void *ptr);
/* Get sum value for ORIGIN type of allocation for the descriptor. */ /* Get sum value for ORIGIN type of allocation for the descriptor. */
T T get_sum (mem_alloc_origin origin);
get_sum (mem_alloc_origin origin);
/* Get all tracked instances registered by the description. Items /* Get all tracked instances registered by the description. Items
are filtered by ORIGIN type, LENGTH is return value where we register 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, the number of elements in the list. If we want to process custom order,
CMP comparator can be provided. */ CMP comparator can be provided. */
mem_list_t * mem_list_t * get_list (mem_alloc_origin origin, unsigned *length,
get_list (mem_alloc_origin origin, unsigned *length, int (*cmp) (const void *first,
int (*cmp) (const void *first, const void *second) = NULL); const void *second) = NULL);
/* Dump all tracked instances of type ORIGIN. If we want to process custom /* Dump all tracked instances of type ORIGIN. If we want to process custom
order, CMP comparator can be provided. */ order, CMP comparator can be provided. */
...@@ -391,7 +382,6 @@ private: ...@@ -391,7 +382,6 @@ private:
reverse_mem_map_t *m_reverse_map; reverse_mem_map_t *m_reverse_map;
}; };
/* Returns true if instance PTR is registered by the memory description. */ /* Returns true if instance PTR is registered by the memory description. */
template <class T> template <class T>
...@@ -410,9 +400,9 @@ mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr) ...@@ -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; 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. */
/* Register memory allocation descriptor for container PTR which is
described by a memory LOCATION. */
template <class T> template <class T>
inline T* inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr, mem_alloc_description<T>::register_descriptor (const void *ptr,
...@@ -584,7 +574,8 @@ template <class T> ...@@ -584,7 +574,8 @@ template <class T>
inline inline
typename mem_alloc_description<T>::mem_list_t * typename mem_alloc_description<T>::mem_list_t *
mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length, 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 /* vec data structure is not used because all vectors generate memory
allocation info a it would create a cycle. */ allocation info a it would create a cycle. */
......
...@@ -141,7 +141,6 @@ vec_prefix::release_overhead (void *ptr, size_t size, bool in_dtor ...@@ -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); vec_mem_desc.release_instance_overhead (ptr, size, in_dtor);
} }
/* Calculate the number of slots to reserve a vector, making sure that /* Calculate the number of slots to reserve a vector, making sure that
it is of at least DESIRED size by growing ALLOC exponentially. */ it is of at least DESIRED size by growing ALLOC exponentially. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment