|
D-Bus 1.4.12
|
DBusCounter and other stuff related to resource limits. More...
Functions | |
| DBusCounter * | _dbus_counter_new (void) |
| Creates a new DBusCounter. | |
| DBusCounter * | _dbus_counter_ref (DBusCounter *counter) |
| Increments refcount of the counter. | |
| void | _dbus_counter_unref (DBusCounter *counter) |
| Decrements refcount of the counter and possibly finalizes the 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. | |
| 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. | |
| long | _dbus_counter_get_size_value (DBusCounter *counter) |
| Gets the current value of the size counter. | |
| long | _dbus_counter_get_unix_fd_value (DBusCounter *counter) |
| Gets the current value of the unix fd counter. | |
| 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 values cross the guard values in either direction (moving up, or moving down). | |
DBusCounter and other stuff related to resource limits.
Types and functions related to tracking resource limits, such as the maximum amount of memory/unix fds a connection can use for messages, etc.
| 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.
Calls the notify function from _dbus_counter_set_notify() if that function has been specified.
| counter | the counter |
| delta | value to add to the size counter's current value |
Definition at line 148 of file dbus-resources.c.
References DBusCounter::notify_data, DBusCounter::notify_function, DBusCounter::notify_size_guard_value, NULL, and DBusCounter::size_value.
Referenced by _dbus_message_add_counter_link(), and _dbus_message_remove_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.
Calls the notify function from _dbus_counter_set_notify() if that function has been specified.
| counter | the counter |
| delta | value to add to the unix fds counter's current value |
Definition at line 178 of file dbus-resources.c.
References DBusCounter::notify_data, DBusCounter::notify_function, DBusCounter::notify_unix_fd_guard_value, NULL, and DBusCounter::unix_fd_value.
Referenced by _dbus_message_add_counter_link(), and _dbus_message_remove_counter().
| long _dbus_counter_get_size_value | ( | DBusCounter * | counter | ) |
Gets the current value of the size counter.
| counter | the counter |
Definition at line 205 of file dbus-resources.c.
References DBusCounter::size_value.
Referenced by _dbus_transport_get_dispatch_status(), and dbus_connection_get_outgoing_size().
| long _dbus_counter_get_unix_fd_value | ( | DBusCounter * | counter | ) |
Gets the current value of the unix fd counter.
| counter | the counter |
Definition at line 217 of file dbus-resources.c.
References DBusCounter::unix_fd_value.
Referenced by _dbus_transport_get_dispatch_status(), and dbus_connection_get_outgoing_unix_fds().
| DBusCounter* _dbus_counter_new | ( | void | ) |
Creates a new DBusCounter.
DBusCounter is used to count usage of some resource such as memory.
Definition at line 82 of file dbus-resources.c.
References dbus_new, DBusCounter::notify_data, DBusCounter::notify_function, DBusCounter::notify_size_guard_value, DBusCounter::notify_unix_fd_guard_value, NULL, DBusCounter::refcount, DBusCounter::size_value, and DBusCounter::unix_fd_value.
Referenced by _dbus_connection_new_for_transport(), and _dbus_transport_init_base().
| DBusCounter* _dbus_counter_ref | ( | DBusCounter * | counter | ) |
Increments refcount of the counter.
| counter | the counter |
Definition at line 109 of file dbus-resources.c.
References _dbus_assert, and DBusCounter::refcount.
Referenced by _dbus_message_add_counter().
| 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 values cross the guard values in either direction (moving up, or moving down).
| counter | the counter |
| size_guard_value | the value we're notified if the size counter crosses |
| unix_fd_guard_value | the value we're notified if the unix fd counter crosses |
| function | function to call in order to notify |
| user_data | data to pass to the function |
Definition at line 234 of file dbus-resources.c.
References DBusCounter::notify_data, DBusCounter::notify_function, DBusCounter::notify_size_guard_value, and DBusCounter::notify_unix_fd_guard_value.
Referenced by _dbus_transport_finalize_base(), _dbus_transport_init_base(), _dbus_transport_set_max_received_size(), and _dbus_transport_set_max_received_unix_fds().
| void _dbus_counter_unref | ( | DBusCounter * | counter | ) |
Decrements refcount of the counter and possibly finalizes the counter.
| counter | the counter |
Definition at line 125 of file dbus-resources.c.
References _dbus_assert, dbus_free(), and DBusCounter::refcount.
Referenced by _dbus_connection_new_for_transport(), _dbus_message_remove_counter(), _dbus_transport_finalize_base(), _dbus_transport_init_base(), and dbus_connection_free_preallocated_send().
1.7.4