* gobject/genums.c: (g_flags_get_first_value): Special-case flag
value of 0. Instead of returning the first random GFlagsValue
we come across, return the GFlagsValue for 0 if it exists or
NULL if it does not exist. Never return the GFlagsValue for 0
if the requested flags value is nonzero.
2005-08-10 Matthias Clasen <mclasen@redhat.com>
* glib/gfileutils.c (g_build_path_va, g_build_pathname_va):
Take a va_list*, not a va_list, to avoid compiler warnings
about uninitialized variables.
2005-08-09 Matthias Clasen <mclasen@redhat.com>
* tests/gobject/Makefile.am (test_programs): Add it here.
* tests/gobject/gvalue-test.c: Beginning of a test suite
for GValue.
2005-08-08 Matthias Clasen <mclasen@redhat.com>
* tests/convert-test.c: Enable the endianness test.
* glib/gconvert.c: Make the caching of iconv descriptors
optional.
* configure.in: Add an --enable-iconv-cache option, and
default to disabling iconv caching on new enough glibc.
Somebody with access to Solaris systems will need to test
if opening/closing of iconv descriptors is enough of
a performance problem to warrant the caching on that
platform. Note that the caching is causing correctness
problems in some corner cases, thus turning it off
is desirable unless it has severe performance implications.
2005-08-08 Matthias Clasen <mclasen@redhat.com>
* tests/Makefile.am: Add convert-test here.
* tests/convert-test.c: Add the beginning of a testsuite
for g_convert() and friends.
2005-08-04 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols:
* glib/gatomic.[hc]: Always export g_atomic_int_get and
g_atomic_pointer_get as functions, even if we have macros,
to avoid changing the ABI depending on configuration.
* glib/gatomic.c: Fix the s390 implementations of
g_atomic_pointer_compare_and_exchange.
2005-08-04 Tor Lillqvist <tml@novell.com>
* glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
the #if/#else/#endif block. Otherwise we had G_BEGIN_DECLS without
matching G_END_DECLS on Unix, and G_END_DECLS without matching
G_BEGIN_DECLS on Win32.
2005-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_convert_with_iconv): Don't go in an
infinite loop if the input text ends in an incomplete multibyte
character. (#312402, Sebastian Bacher)
2005-08-02 Tor Lillqvist <tml@novell.com>
* tests/refcount/objects.c
* tests/refcount/properties.c
* tests/refcount/signals.c: Use g_usleep() instead of sleep() for
portability.
Mon Aug 1 23:33:47 2005 Tim Janik <timj@imendio.com>
* tests/refcount/closures.c: test high contention on closure
reference counts to trigger and catch non-atomic updates.
* tests/refcount/objects.c:
* tests/refcount/objects2.c:
* tests/refcount/properties.c:
* tests/refcount/properties2.c:
* tests/refcount/signals.c:
fixed up test and threading fundamentals. variables accessed from all
threads need to be volatile. context switches are enforced by using
g_thread_yield(), not g_usleep(1) which may result in busy waits on
some platforms. for testcode, always consider all warnings and
critical messages fatal. issue the currently running program on
stdout. improved progress indicators.
* tests/refcount/properties.c:
* tests/refcount/objects.c:
don't overdo the number of testing threads to keep the testing machine
usable, 2 threads can produce as much contention as 20 if executing the
same code.
* tests/refcount/signals.c: only start 1 thread per object. GObject
doesn't provide mutually exclusive object access, but only mutually
exclusive reference count modification.
* tests/Makefile.am: added closures test.
2005-08-01 Tor Lillqvist <tml@novell.com>
* tests/uri-test.c: Make it pass on Win32.
(from_uri_tests[]): Take into consideration that on Win32 we don't
return "localhost" hostnames.
(safe_strcmp_filename): New function that considers slash and
backslash equal on Win32.
(run_roundtrip_tests): Use safe_strcmp_filename().
Sun Jul 31 01:50:20 2005 Tim Janik <timj@gtk.org>
* glib/gdataset.c:
moved G_DATALIST_*_POINTER() macros here, because proper use requires
the global g_dataset_global mutex to be acquired.
g_datalist_id_get_data():
g_datalist_unset_flags():
g_datalist_set_flags(): properly acquire and release dataset mutex.
* glib/gdatasetprivate.h: implement G_DATALIST_GET_FLAGS() via atomic
pointer access to account for memory barriers. moved all other macros.
2005-07-26 Matthias Clasen <mclasen@redhat.com>
* configure.in: Try -mt as compiler flag for threads, needed
for the HP C compiler on HP-UX. (#163051, Paul Cornett)
2005-07-20 Matthias Clasen <mclasen@redhat.com>
* glib/gthreadpool.c (g_thread_pool_free): Don't get
stuck in here if immediate is TRUE. (#310954,
Hong Jen Yee)
* tests/threadpool-test.c (main): Test immediate == TRUE.
2005-07-20 Tor Lillqvist <tml@novell.com>
* glib/gutils.h (g_win32_get_system_data_dirs): Make this an
inline function. Define it only if G_CAN_INLINE and not
C++. (#173098)
2005-07-19 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_string_chunk_insert_len): Avoid
an unnecessary strlen if len is -1. (#169692,
Benoit Dejean)
2005-07-15 Matthias Clasen <mclasen@redhat.com>
Make refcounting threadsafe by using atomic
operations. (#166020, Wim Taymans)
* gobject.c: Use a recursive lock to protect the
notify queue.
(g_object_unref): Get rid of g_object_last_unref and
do the last unref handling in g_object_unref.
(g_object_ref, g_object_unref): Use atomic operations.
* gsignal.c (struct _HandlerMatch): Use a full integer
for the ref_count field.
(handler_ref, handler_unref_R): Use atomic operations.
* gparam.c (g_param_spec_ref, g_param_spec_unref):
Use atomic operations instead of a lock to make the
refcounting threadsafe.
* gclosure.c (g_closure_ref, g_closure_unref): Use atomic
operations. This is more complicated here, since the
refcount is stored in a bitfield, so we also have
to access all other bitfield members atomically.
* gsignal.c (handlers_find): Read the meta_marshal flag
of the closure atomically.
* tests/Makefile.am (SUBDIRS): Add tests/refcount
* configure.in: Add tests/refcount
* tests/refcount/properties.c: Test property changes
from multiple threads.
* tests/refcount/signals.c: Test signal emission from
multiple threads.
* tests/refcount/objects.c: Test refcounting from
multiple threads.
* tests/refcount/objects2.c:
* tests/refcount/properties2.c: Tests to measure the
overhead of threadsafe refcounting.
* glib/giochannel.c (g_io_channel_ref, g_io_channel_unref):
Use atomic operations to make refcounting
threadsafe. (#166020, Wim Taymans)