From 1b1dfafc344ad7b60b8156a1bbdbfc1b364bfa98 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 13 Nov 2004 07:07:47 +0000 Subject: 2004-11-13 Havoc Pennington * test/glib/test-profile.c: fix this thing up a bit * dbus/dbus-message.c (dbus_message_new_empty_header): increase preallocation sizes by a fair bit; not sure if this will be an overall performance win or not, but it does reduce reallocs. * dbus/dbus-string.c (set_length, reallocate_for_length): ignore the test hack that forced constant realloc if asserts are disabled, so we can profile sanely. Sprinkle in some _DBUS_UNLIKELY() which are probably pointless, but before I noticed the real performance problem I put them in. (_dbus_string_validate_utf8): micro-optimize this thing a little bit, though callgrind says it didn't help; then special-case ascii, which did help a lot; then be sure we detect nul bytes as invalid, which is a bugfix. (align_length_then_lengthen): add some more _DBUS_UNLIKELY superstition; use memset to nul the padding instead of a manual loop. (_dbus_string_get_length): inline this as a macro; it showed up in the profile because it's used for loop tests and so forth --- glib/dbus-gmain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glib/dbus-gmain.c') diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c index 30b1c4e0..a6c7d25c 100644 --- a/glib/dbus-gmain.c +++ b/glib/dbus-gmain.c @@ -327,7 +327,7 @@ remove_watch (DBusWatch *watch, return; /* probably a not-enabled watch that was added */ watch_fd->removed = TRUE; - watch_fd->watch = NULL; + watch_fd->watch = NULL; dbus_source->watch_fds = g_list_remove (dbus_source->watch_fds, watch_fd); @@ -409,7 +409,7 @@ timeout_toggled (DBusTimeout *timeout, static void free_source (GSource *source) -{ +{ g_source_destroy (source); } -- cgit