From bfad32422f1f78bce4de1e88a4afb5cc295bb877 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 20 May 2009 01:32:46 +0200 Subject: unix-fd: add logic to count unix fds the same way as allocated memory This make all counters count both bytes of memory and unix fds. --- dbus/dbus-resources.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'dbus/dbus-resources.h') diff --git a/dbus/dbus-resources.h b/dbus/dbus-resources.h index 7b6e0d46..cf3cc1a6 100644 --- a/dbus/dbus-resources.h +++ b/dbus/dbus-resources.h @@ -37,14 +37,19 @@ typedef void (* DBusCounterNotifyFunction) (DBusCounter *counter, DBusCounter* _dbus_counter_new (void); DBusCounter* _dbus_counter_ref (DBusCounter *counter); void _dbus_counter_unref (DBusCounter *counter); -void _dbus_counter_adjust (DBusCounter *counter, - long delta); -long _dbus_counter_get_value (DBusCounter *counter); - -void _dbus_counter_set_notify (DBusCounter *counter, - long guard_value, - DBusCounterNotifyFunction function, - void *user_data); + +void _dbus_counter_adjust_size (DBusCounter *counter, + long delta); +void _dbus_counter_adjust_unix_fd (DBusCounter *counter, + long delta); +long _dbus_counter_get_size_value (DBusCounter *counter); +long _dbus_counter_get_unix_fd_value (DBusCounter *counter); + +void _dbus_counter_set_notify (DBusCounter *counter, + long size_guard_value, + long unix_fd_guard_value, + DBusCounterNotifyFunction function, + void *user_data); DBUS_END_DECLS -- cgit