mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-04-29 10:30:37 +02:00
DBusList: add usage stats
Reviewed-by: Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34040
This commit is contained in:
parent
82bc508785
commit
2351f57081
2 changed files with 17 additions and 2 deletions
|
|
@ -146,6 +146,18 @@ link_after (DBusList **list,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DBUS_ENABLE_STATS
|
||||
void
|
||||
_dbus_list_get_stats (dbus_uint32_t *in_use_p,
|
||||
dbus_uint32_t *in_free_list_p,
|
||||
dbus_uint32_t *allocated_p)
|
||||
{
|
||||
_DBUS_LOCK (list);
|
||||
_dbus_mem_pool_get_stats (list_pool, in_use_p, in_free_list_p, allocated_p);
|
||||
_DBUS_UNLOCK (list);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -84,8 +84,6 @@ void _dbus_list_prepend_link (DBusList **list,
|
|||
dbus_bool_t _dbus_list_length_is_one (DBusList **list);
|
||||
|
||||
|
||||
|
||||
|
||||
void _dbus_list_foreach (DBusList **list,
|
||||
DBusForeachFunction function,
|
||||
void *data);
|
||||
|
|
@ -93,6 +91,11 @@ void _dbus_list_foreach (DBusList **list,
|
|||
#define _dbus_list_get_next_link(list, link) ((link)->next == *(list) ? NULL : (link)->next)
|
||||
#define _dbus_list_get_prev_link(list, link) ((link) == *(list) ? NULL : (link)->prev)
|
||||
|
||||
/* if DBUS_ENABLE_STATS */
|
||||
void _dbus_list_get_stats (dbus_uint32_t *in_use_p,
|
||||
dbus_uint32_t *in_free_list_p,
|
||||
dbus_uint32_t *allocated_p);
|
||||
|
||||
DBUS_END_DECLS
|
||||
|
||||
#endif /* DBUS_LIST_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue