25 #include <dbus/dbus-resources.h>
26 #include <dbus/dbus-internals.h>
61 #ifdef DBUS_ENABLE_STATS
63 long peak_unix_fd_value;
155 #ifdef DBUS_ENABLE_STATS
156 if (counter->peak_size_value < counter->
size_value)
157 counter->peak_size_value = counter->
size_value;
161 _dbus_verbose (
"Adjusting counter %ld by %ld = %ld\n",
166 ((old < counter->notify_size_guard_value &&
209 #ifdef DBUS_ENABLE_STATS
215 _dbus_verbose (
"Adjusting counter %ld by %ld = %ld\n",
220 ((old < counter->notify_unix_fd_guard_value &&
264 long size_guard_value,
265 long unix_fd_guard_value,
266 DBusCounterNotifyFunction
function,
276 #ifdef DBUS_ENABLE_STATS
278 _dbus_counter_get_peak_size_value (
DBusCounter *counter)
280 return counter->peak_size_value;
284 _dbus_counter_get_peak_unix_fd_value (
DBusCounter *counter)
286 return counter->peak_unix_fd_value;
#define NULL
A null pointer, defined appropriately for C or C++.
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
Internals of DBusCounter.
DBusCounterNotifyFunction notify_function
notify function
DBusCounter * _dbus_counter_ref(DBusCounter *counter)
Increments refcount of the counter.
long size_value
current size counter value
void * notify_data
data for notify function
#define dbus_new0(type, count)
Safe macro for using dbus_malloc0().
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
void _dbus_counter_unref(DBusCounter *counter)
Decrements refcount of the counter and possibly finalizes the counter.
void _dbus_counter_adjust_unix_fd(DBusCounter *counter, long delta)
Adjusts the value of the unix fd counter by the given delta which may be positive or negative...
dbus_bool_t notify_pending
TRUE if the guard value has been crossed.
long unix_fd_value
current unix fd counter value
#define TRUE
Expands to "1".
void _dbus_counter_set_notify(DBusCounter *counter, long size_guard_value, long unix_fd_guard_value, DBusCounterNotifyFunction function, void *user_data)
Sets the notify function for this counter; the notify function is called whenever the counter's value...
void _dbus_counter_notify(DBusCounter *counter)
Calls the notify function from _dbus_counter_set_notify(), if that function has been specified and th...
long notify_unix_fd_guard_value
call notify function when crossing this unix fd value
long notify_size_guard_value
call notify function when crossing this size value
DBusCounter * _dbus_counter_new(void)
Creates a new DBusCounter.
int refcount
reference count
#define FALSE
Expands to "0".
long _dbus_counter_get_unix_fd_value(DBusCounter *counter)
Gets the current value of the unix fd counter.
long _dbus_counter_get_size_value(DBusCounter *counter)
Gets the current value of the size counter.
void _dbus_counter_adjust_size(DBusCounter *counter, long delta)
Adjusts the value of the size counter by the given delta which may be positive or negative...