2006-01-17 Sebastian Wilhelmi <seppi@seppi.de>
* glib/gthreadpool.c: To avoid deadlocks get rid of the settings
G_LOCK. Use the unused_thread_queue lock instead. Change
g_thread_pool_thread_proxy such that threads only wait on
non-exlusive pools for at most a 1/2 second. Do not reorder tasks
due to superfluous tasks. Global tasks wait at most for
max-idle-time milliseconds. Make sure, that no task is woken up
twice for the same event via a wakeup_serial. This fixes#324228.
* tests/threadpool-test.c: Adapt test accordingly. Do not pass
invalid NULL into the thread pools. This as well fixes#327290.
2006-01-16 Matthias Clasen <mclasen@redhat.com>
* glib/gthread.h (g_static_mutex_get_mutex_impl_shortcut):
Rework the strict aliasing fix to not break C++, pointed
out by Murray Cumming.
2006-01-16 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.c (g_async_queue_push_sorted_unlocked):
Signal waiting threads, problem noticed by Christian Kellner.
2006-01-16 Matthias Clasen <mclasen@redhat.com>
Fix bug 326747, Alberto Ruiz:
* glib/gconvert.c (make_valid_utf8): Change this function to
replace unknown characters by the Unicode replacement character
instead of '?', and don't append "(invalid encoding)".
(g_filename_display_name, g_filename_display_basename): Document
how to determine if the filename was in an invalid encoding.
2006-01-14 Matthias Clasen <mclasen@redhat.com>
* glib/gtree.c: Replace the simple recursive implementation
by a nonrecursive, threaded implementation by Maurizio
Monge. (#169285)
2005-12-20 Sven Herzberg <herzi@gnome-de.org>
* docs/reference/gobject/tmpl/gtype.sgml: explain that
G_TYPE_INSTANCE_GET_CLASS() does behave different during
initialization
2006-01-04 Manish Singh <yosh@gimp.org>
* glib/glib.symbols
* glib/gstdio.h: don't macroized g_access, g_chdir, and g_unlink
either, since they have the same issue as g_rmdir. (Related to
bug #325249)
Wed Jan 4 13:33:25 2006 Tim Janik <timj@gtk.org>
* glib/gslice.c (magazine_cache_pop_magazine): don't reverse chunk
order when creating magazines, so we hand out chunks with ascending
adresses.
* docs/reference/glib/glib-sections.txt:
* glib/glib.symbols:
* glib/gthreadpool.[ch]:
- Added new API g_thread_pool_get_idle_time() and
g_thread_pool_set_idle_time(). (#324228).
* tests/threadpool-test.c:
- Updated test case to do thread pool sorting, thread pool with
no sorting and a thread pool with idle thread timeouts.
2005-12-20 Michael Meeks <michael.meeks@novell.com>
* glib/gmain.c (g_main_context_is_owner): new method
to determine if the current thread is the owner of the
context.
2006-01-02 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols:
* glib/gstdio.h:
* glib/gstdio.c (g_rmdir): Don't provide g_rmdir() as a macro
expanding to rmdir, since rmdir is not declared in a portable
system header we can include in gstdio.h. (#325249, Jani Monoses)
2006-01-01 Tor Lillqvist <tml@novell.com>
* glib/gspawn-win32.c (g_spawn_sync_utf8): Set the GIOChannels for
stdout and stderr to unbuffered. Otherwise the giochannel layer
will try to read from them regardless whether the
g_io_channel_win32_poll() call here has indicated
readability or not. (#325310)
2005-12-27 Matthias Clasen <mclasen@redhat.com>
Fix#316221, Michal Benes, Stanislav Brabec;
* configure.in: Fix a strict aliasing problem in
g_static_mutex_get_mutex().
* glib/gthread.h: ...and in
g_static_mutex_get_mutex_impl_shortcut().
2005-12-20 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols:
* glib/gthreadpool.h:
* glib/gthreadpool.c (g_thread_pool_set_sort_function): New function
to sort tasks pushed into a threadpool. (#324479, Martyn Russell)
* tests/threadpool-test.c: Test this.
Tue Dec 20 18:14:14 2005 Tim Janik <timj@imendio.com>
* glib/gslice.[hc]: added mem_error() and mem_assert() to test and
handle errors without depending on gmessage.c which might not be
setup when the error occours.
removed G_SLICE_CONFIG_ALWAYS_FREE config option, fixed the code so
always freeing can be achieved by adjusting the working set time to
0 with G_SLICE_CONFIG_WORKING_SET_MSECS.
added G_SLICE_CONFIG_COLOR_INCREMENT to test different color increments
(mainly 0 and 1). reduced the minimum block size to 128 bytes, to
minimize wastage if small amounts of differently sized structrues are
allocated, this does come at a performance cost of roughly 5% though.
fixed up block alignment calculation, so it works for varying
block sizes. only use strerror() not g_strerror() since the latter
depends on working GQuark and GSlice.
mem_error(): implemented in terms of fprintf and vfprintf.
* tests/slice-color.c: new program to test cache colorization effects.
* tests/slice-test.c: trade G_SLICE_CONFIG_ALWAYS_FREE for 0 duration
G_SLICE_CONFIG_WORKING_SET_MSECS.
2005-12-17 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (parse_short_option): Set an error in all
failure cases. (#324332, Tim-Philipp Müller)
2005-12-17 Sebastian Wilhelmi <seppi@seppi.de>
* glib/gatomic.c: Fix memory barrier position in g_atomic_int_get
and g_atomic_pointer_get. Add g_atomic_int_set and
g_atomic_pointer_set implementations for the !DEFINE_WITH_MUTEXES &&
G_ATOMIC_OP_MEMORY_BARRIER_NEEDED case, as well as defining them
as functions (additionally to the macros in the header) for the
!G_ATOMIC_OP_MEMORY_BARRIER_NEEDED case.
2005-12-16 Matthias Clasen <mclasen@redhat.com>
* glib/gmem.c (g_allocator_new): Don't return a pointer to
a const struct, since apps expect to be able to modify it.
(#324179, J. Ali Harlow)
Tue Dec 13 10:13:32 2005 Tim Janik <timj@imendio.com>
* glib/gatomic.h: added g_atomic_pointer_set() and g_atomic_int_set()
for systems where the initialization of atomic variables requires a
write memory barrier.
2005-12-09 Alexander Larsson <alexl@redhat.com>
* glib/glist.h:
* glib/gslist.h:
Use G_GNUC_WARN_UNUSED_RESULT on list functions that return
the whole list.
* glib/gasyncqueue.c:
- Call g_queue_insert_sorted() instead of duplicating the code.
- Call g_queue_sort() instead of duplicating the code.
- Invert sort function results to make sure the same sort function
gives the same results across glist, gslist, gqueue and
gasyncqueue.
* tests/asyncqueue-test.c:
- Updated the sort function to reflect the example in the
documentation for gasyncqueue.c.
2005-12-07 Tor Lillqvist <tml@novell.com>
* glib-gettextize.in: Look up prefix at run-time on Win32,
assuming the standard directory structure with glib-gettextize in
$prefix/bin.
2005-12-06 Matthias Clasen <mclasen@redhat.com>
* glib/gmem.h: Exempt GTK+ from the mem chunk deprecation, since
we need GTK+ 2.8 to compile against GLib 2.10.
2005-12-05 Matthias Clasen <mclasen@redhat.com>
* tests/Makefile.am (TESTS_ENVIRONMENT):
* tests/gobject/Makefile.am (TESTS_ENVIRONMENT): Set
MALLOC_CHECK_ and MALLOC_PERTURB_
* tests/run-collate-tests.sh: Run the collation tests explicitly
in en_US locale. (#320463)
* docs/reference/glib/glib-sections.txt:
* glib/gasyncqueue.[ch]:
- Added support for sorting async queues by with _push_sorted(),
_push_sorted_unlocked(), _sort() and _sort_unlocked() (#323047).
* tests/Makefile.am:
* tests/asyncqueue-test.c:
- Added test case for gasyncqueue.c
Mon Dec 5 15:53:20 2005 Tim Janik <timj@imendio.com>
* glib/gslice.c: implement chain walking for arbitrary ->next pointer
offsets in g_slice_free_chain_with_offset() based on a patch by behdad
in bug 323178. moved time consuming logic from g_slice_free() out of
the inner loop, so g_slice_free_chain_with_offset() provides a real
performance benefit over g_slice_free1() now.
* glib/gslice.h: renamed g_slice_free_chain() to
g_slice_free_chain_with_offset(). implemented g_slice_free_chain() as
a type-safe macro as suggested in bug 323178.
simplified the macro implementation of g_slice_free() and implemented
it in a type safe manner for all compliers as suggested by Morten
Welinder <mortenw@gnome.org>.
* glib/gmain.c:
* glib/glist.c:
* glib/gslist.c:
* glib/glib.symbols: s/g_slice_free_chain/g_slice_free_chain_with_offset/
2005-12-05 Matthias Clasen <mclasen@redhat.com>
* tests/libmoduletestplugin_a.c: Fix compiler warnings.
* glib/gatomic.c: In the ia64 implementation, use
__sync builtin without _si or _di suffix. (#321229,
Stanislav Brabec, patch by Andreas Schwab)
2005-12-04 Matthias Clasen <mclasen@redhat.com>
Handle multiple user names with the same UID better.
(#319535, Laszlo Peter)
* glib/gutils.c (g_get_any_init_do): When determining user
data, first look up $LOGNAME. If the UID doesn't match
getuid(), fall back to the current behaviour of looking
up the user data based on getuid().
2005-12-04 Matthias Clasen <mclasen@redhat.com>
* glib/gmacros.h (G_GNUC_WARN_UNUSED_RESULT): Add a macro
to make gcc warn if a function result is ignored. (#145466,
Arjan van de Ven, Alex Larsson)
* glib/gmem.h: Add the new attribute to g_realloc and
g_try_realloc.
2005-12-03 Matthias Clasen <mclasen@redhat.com>
* glib/gfileutils.c: Don't fork a new process just to
fix the permissions of the created temp file. (#321318,
Alexis S. L. Carvalho)
2005-12-02 Matthias Clasen <mclasen@redhat.com>
* glib/gspawn.c:
* configure.in: Remove support for Solaris threads.
(#136971, Sebastian Wilhelmi, patch by Andrew Paprocki)
Fri Dec 2 13:08:58 2005 Tim Janik <timj@gtk.org>
* glib/gslice.h (g_slice_free): reworked GCC-specific type-safe macro
variant into something less verbose, but digestible for gcc-3.4.
Fri Dec 2 10:55:07 2005 Tim Janik <timj@imendio.com>
* tests/slice-test.c: extended to perform the benchmarking on the old
memchunk code if 'O' is selected.
* tests/memchunks.c: new file which contains the old GLib mem chunks
implementation with prefix old_mem_chunk_.
* tests/Makefile.am: added memchunks.c
Fri Dec 2 00:16:59 2005 Tim Janik <timj@imendio.com>
* glib/gslice.c: improved gettimeofday() timer resolution by maintaining
acceptable load distribution of the syscall.
(allocator_get_magazine_threshold): reduce minimum/single-thread magazine
sizes to approximately page_size/2.5 to avoid excessive startup allocations.
Fri Dec 2 00:16:59 2005 Tim Janik <timj@imendio.com>
* glib/gslice.c: improved gettimeofday() timer resolution by maintaining
acceptable load distribution of the syscall.
(slab_allocator_free_chunk): reduce minimum/single-thread magazine sizes
to approximately page_size/2.5 to avoid excessive startup allocations.
Thu Dec 1 17:32:46 2005 Tim Janik <timj@imendio.com>
* glib/gslice.[hc]: new slice allocator implementation.
* tests/slice-test.c: added random slice allocation test.
* glib/gthread.[hc]: removed newly added private thread mem API.
* glib/gthreadinit.h:
* glib/gmessages.c:
* glib/gthread.c:
* glib/gmem.c: divided glib threading initialisation into three phases,
initialisation where private keys and messaging are not available (only
needed by gmem.c), initialisation without messaging but private keys
available (gslice.c, gmessage.c), and full fledged initialisers that
server the rest of glib. initialisation functions got renamed to reflect
the limitations of their corresponding phases.
* glib/gmem.c: removed memchunk code, defer allocations to
g_slice_* instead.
* glib/gmem.[hc]: removed g_slice_* skeletons.
* glib/glib.symbols: added g_slice_* symbols.
* configure.in: check for availability of posix_memalign(3), memalign(3)
and valloc(3).
* glib/Makefile.am: added gslice.[hc].
2005-12-01 Tor Lillqvist <tml@novell.com>
* glib/gstdio.c (g_stat): In the Win32 implementation, strip
trailing slash(es) for non-root folders. stat() fails if non-root
folders are specified with trailing slashes. It's too much hassle
to demand that callers strip such slashes themselves, especially
as it is easy to get it wrong and strip the slash of a root
folder.
(g_rename): On NT-based Windows, use MoveFileEx() with
MOVEFILE_REPLACE_EXISTING to better match Unix behaviour.
2005-11-28 Matthias Clasen <mclasen@redhat.com>
Fix G_STMT_START / G_STMT_END on Solaris. (#321972,
Andrew Paprocki)
* configure.in: Check whether do { } while (0) works.
* glib/gmacros.h: Use do { } while (0) for G_STMT_START /
G_STMT_END if it works.
Wed Nov 23 17:34:01 2005 Tim Janik <timj@imendio.com>
* glib/gdataset.c: access datalist flags via atomic pointer access
funcitons, instead of acquiring the dataset lock. this is faster and
also matches the atomic pointer readouts in gdatalistprivate.h and
direct pointer modifications required by gobject.c.
2005-11-22 Matthias Clasen <mclasen@redhat.com>
Avoid double locking in g_intern_string (#322133,
Benedikt Meurer)
* glib/gdataset.c (g_quark_from_string_internal): New
internal function which factors out common parts of
g_quark_from[_static]_string.
(g_quark_from_string, g_quark_from_static_string):
Use g_quark_from_string_internal.
(g_intern_string, g_intern_static_string): Use
g_quark_from_string_internal, and only take the
lock once.
(g_quark_new): Don't store the strings shifted by -1
in the g_quarks array.
(g_quark_to_string): Adapt to the previous change.