-/* -*- mode: C; c-file-style: "gnu" -*- */
-/* dbus-list.c Generic linked list utility (internal to D-BUS implementation)
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* dbus-list.c Generic linked list utility (internal to D-Bus implementation)
*
* Copyright (C) 2002 Red Hat, Inc.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+#include <config.h>
#include "dbus-internals.h"
#include "dbus-list.h"
#include "dbus-mempool.h"
{
DBusList *link;
- if (!_DBUS_LOCK (list))
- return NULL;
+ _DBUS_LOCK (list);
if (list_pool == NULL)
{
}
}
-#ifdef DBUS_BUILD_TESTS
static void
link_after (DBusList **list,
DBusList *after_this_link,
link->next->prev = link;
}
}
-#endif /* DBUS_BUILD_TESTS */
+
+#ifdef DBUS_ENABLE_STATS
+void
+_dbus_list_get_stats (dbus_uint32_t *in_use_p,
+ dbus_uint32_t *in_free_list_p,
+ dbus_uint32_t *allocated_p)
+{
+ _DBUS_LOCK (list);
+ _dbus_mem_pool_get_stats (list_pool, in_use_p, in_free_list_p, allocated_p);
+ _DBUS_UNLOCK (list);
+}
+#endif
/** @} */
}
#endif /* DBUS_BUILD_TESTS */
-#ifdef DBUS_BUILD_TESTS
/**
* Inserts data into the list after the given existing link.
*
return TRUE;
}
-#endif /* DBUS_BUILD_TESTS */
/**
* Inserts a link into the list before the given existing link.
link_before (list, before_this_link, link);
}
-#ifdef DBUS_BUILD_TESTS
/**
* Inserts a link into the list after the given existing link.
*
else
link_after (list, after_this_link, link);
}
-#endif /* DBUS_BUILD_TESTS */
/**
* Removes a value from the list. Only removes the