From c3af5ccdbc22e8990d04ec2f89ad1f2e053655e9 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 24 Mar 2003 03:16:58 +0000 Subject: 2003-03-23 Havoc Pennington * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with DBUS_BUILD_TESTS, actually alloc/free a block of memory for the mutex, so we can check for proper memory management and OOM handling. * dbus/dbus-dataslot.c: remove the mutex from DBusDataSlotAllocator and lock it manually when using it, to simplify fitting it into the global slots framework. * dbus/dbus-threads.c (init_static_locks): rework how we're handling global locks so they are easily shut down. * bus/policy.c (bus_policy_append_rule): fix * bus/test-main.c (main): check for memleaks * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make test suite check for memleaks * dbus/dbus-memory.c: add support in test mode for tracking number of outstanding blocks --- dbus/dbus-dataslot.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'dbus/dbus-dataslot.h') diff --git a/dbus/dbus-dataslot.h b/dbus/dbus-dataslot.h index 4bb6091f..d4357325 100644 --- a/dbus/dbus-dataslot.h +++ b/dbus/dbus-dataslot.h @@ -53,23 +53,24 @@ struct DBusDataSlotList int n_slots; /**< Slots we have storage for in data_slots */ }; -dbus_bool_t _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator); -int _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator); -void _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator, - int slot_id); +dbus_bool_t _dbus_data_slot_allocator_init (DBusDataSlotAllocator *allocator); +int _dbus_data_slot_allocator_alloc (DBusDataSlotAllocator *allocator, + DBusMutex *mutex); +void _dbus_data_slot_allocator_free (DBusDataSlotAllocator *allocator, + int slot_id); +void _dbus_data_slot_list_init (DBusDataSlotList *list); +dbus_bool_t _dbus_data_slot_list_set (DBusDataSlotAllocator *allocator, + DBusDataSlotList *list, + int slot, + void *data, + DBusFreeFunction free_data_func, + DBusFreeFunction *old_free_func, + void **old_data); +void* _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator, + DBusDataSlotList *list, + int slot); +void _dbus_data_slot_list_free (DBusDataSlotList *list); -void _dbus_data_slot_list_init (DBusDataSlotList *list); -dbus_bool_t _dbus_data_slot_list_set (DBusDataSlotAllocator *allocator, - DBusDataSlotList *list, - int slot, - void *data, - DBusFreeFunction free_data_func, - DBusFreeFunction *old_free_func, - void **old_data); -void* _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator, - DBusDataSlotList *list, - int slot); -void _dbus_data_slot_list_free (DBusDataSlotList *list); DBUS_END_DECLS; -- cgit