From a58180de0e720f7fca46a5af69a7b27b5e102a1d Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 26 Nov 2004 06:22:53 +0000 Subject: 2004-11-26 Havoc Pennington * dbus/dbus-message.c (struct DBusMessage): put the locked bit and the "char byte_order" next to each other to save 4 bytes (dbus_message_new_empty_header): reduce preallocation, since the message cache should achieve a similar effect (dbus_message_cache_or_finalize, dbus_message_get_cached): add a message cache that keeps a few DBusMessage around in a pool, another 8% speedup or so. * dbus/dbus-dataslot.c (_dbus_data_slot_list_clear): new function --- dbus/dbus-dataslot.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'dbus/dbus-dataslot.c') diff --git a/dbus/dbus-dataslot.c b/dbus/dbus-dataslot.c index ef4a493b..675f5cf6 100644 --- a/dbus/dbus-dataslot.c +++ b/dbus/dbus-dataslot.c @@ -316,14 +316,13 @@ _dbus_data_slot_list_get (DBusDataSlotAllocator *allocator, } /** - * Frees the data slot list and all data slots contained - * in it, calling application-provided free functions - * if they exist. + * Frees all data slots contained in the list, calling + * application-provided free functions if they exist. * - * @param list the list to free + * @param list the list to clear */ void -_dbus_data_slot_list_free (DBusDataSlotList *list) +_dbus_data_slot_list_clear (DBusDataSlotList *list) { int i; @@ -336,7 +335,20 @@ _dbus_data_slot_list_free (DBusDataSlotList *list) list->slots[i].free_data_func = NULL; ++i; } +} +/** + * Frees the data slot list and all data slots contained + * in it, calling application-provided free functions + * if they exist. + * + * @param list the list to free + */ +void +_dbus_data_slot_list_free (DBusDataSlotList *list) +{ + _dbus_data_slot_list_clear (list); + dbus_free (list->slots); list->slots = NULL; list->n_slots = 0; -- cgit