improved gettimeofday() timer resolution by maintaining acceptable load
[platform/upstream/glib.git] / ChangeLog.pre-2-12
1 Fri Dec  2 00:16:59 2005  Tim Janik  <timj@imendio.com>
2
3         * glib/gslice.c: improved gettimeofday() timer resolution by maintaining
4         acceptable load distribution of the syscall.
5         (slab_allocator_free_chunk): reduce minimum/single-thread magazine sizes
6         to approximately page_size/2.5 to avoid excessive startup allocations.
7
8 2005-12-01  Matthias Clasen  <mclasen@redhat.com>
9
10         * tests/gobject/ifacecheck.c (test_iface_base_init): Don't
11         double-free base interface members.
12
13         * tests/Makefile.am: Remove duplicate variable.
14
15 Thu Dec  1 17:32:46 2005  Tim Janik  <timj@imendio.com>
16
17         * glib/gslice.[hc]: new slice allocator implementation.
18
19         * tests/slice-test.c: added random slice allocation test.
20
21         * glib/gthread.[hc]: removed newly added private thread mem API.
22
23         * glib/gthreadinit.h:
24         * glib/gmessages.c:
25         * glib/gthread.c:
26         * glib/gmem.c: divided glib threading initialisation into three phases,
27         initialisation where private keys and messaging are not available (only
28         needed by gmem.c), initialisation without messaging but private keys
29         available (gslice.c, gmessage.c), and full fledged initialisers that
30         server the rest of glib. initialisation functions got renamed to reflect
31         the limitations of their corresponding phases.
32
33         * glib/gmem.c: removed memchunk code, defer allocations to 
34         g_slice_* instead.
35
36         * glib/gmem.[hc]: removed g_slice_* skeletons.
37
38         * glib/glib.symbols: added g_slice_* symbols.
39
40         * configure.in: check for availability of posix_memalign(3), memalign(3)
41         and valloc(3). 
42
43         * glib/Makefile.am: added gslice.[hc].
44
45 2005-12-01  Tor Lillqvist  <tml@novell.com>
46
47         * glib/gstdio.c (g_stat): In the Win32 implementation, strip
48         trailing slash(es) for non-root folders. stat() fails if non-root
49         folders are specified with trailing slashes. It's too much hassle
50         to demand that callers strip such slashes themselves, especially
51         as it is easy to get it wrong and strip the slash of a root
52         folder.
53         (g_rename): On NT-based Windows, use MoveFileEx() with
54         MOVEFILE_REPLACE_EXISTING to better match Unix behaviour.
55
56 2005-11-28  Matthias Clasen  <mclasen@redhat.com>
57
58         Fix G_STMT_START / G_STMT_END on Solaris.  (#321972,
59         Andrew Paprocki)
60         
61         * configure.in: Check whether do { } while (0) works.
62
63         * glib/gmacros.h: Use do { } while (0) for G_STMT_START / 
64         G_STMT_END if it works.
65         
66 2005-11-28  Matthias Clasen  <mclasen@redhat.com>
67
68         * glib/gthread.c (g_static_rw_lock_wait, g_static_rw_lock_signal): 
69         * glib/gnode.c (g_node_depth_traverse_level): 
70         * glib/gmem.c (g_allocator_new): 
71         * glib/ghash.c (g_hash_table_unref, g_hash_table_destroy) 
72         (g_hash_table_foreach_remove_or_steal): Silence compiler
73         warnings.
74
75 2005-11-27  Matthias Clasen  <mclasen@redhat.com>
76
77         * glib/gunicollate.c (g_utf8_collate_key_for_filename): 
78         Don't read beyond len.  (#322520, Christian Persch)
79
80 Wed Nov 23 17:34:01 2005  Tim Janik  <timj@imendio.com>
81
82         * glib/gdataset.c: access datalist flags via atomic pointer access
83         functions, instead of acquiring the dataset lock. this is faster and
84         also matches the atomic pointer readouts in gdatalistprivate.h and
85         direct pointer modifications required by gobject.c.
86
87 Wed Nov 23 13:35:31 2005  Tim Janik  <timj@gtk.org>
88
89         * glib/gdataset.c: streamlined initialization code somewhat,
90         removed GData node cache.
91
92 2005-11-22  Matthias Clasen  <mclasen@redhat.com>
93
94         * glib/ghash.c (g_hash_table_ref): 
95         (g_hash_table_unref): Mark these as new API.
96
97         Avoid double locking in g_intern_string (#322133,
98         Benedikt Meurer)
99
100         * glib/gdataset.c (g_quark_from_string_internal): New 
101         internal function which factors out common parts of 
102         g_quark_from[_static]_string.
103         (g_quark_from_string, g_quark_from_static_string):
104         Use g_quark_from_string_internal.
105         (g_intern_string, g_intern_static_string): Use
106         g_quark_from_string_internal, and only take the
107         lock once.
108         (g_quark_new): Don't store the strings shifted by -1
109         in the g_quarks array.
110         (g_quark_to_string): Adapt to the previous change.
111
112 Tue Nov 22 14:04:26 2005  Tim Janik  <timj@imendio.com>
113
114         * glib/ghash.h: 
115         * glib/ghash.c: 
116         g_hash_table_new_full(): create hash tables with a ref count of 1.
117         g_hash_table_ref(): atomically ref_count+=1
118         g_hash_table_unref(): atomically ref_count-=1, destroys hash table
119         when refcount reaches 0.
120         g_hash_table_destroy(): just destroy keys and values, unref by 1.
121         g_hash_table_insert(): 
122         g_hash_table_replace(): assert ref_count>0.
123
124         * glib/gatomic.h: 
125         * glib/gatomic.c: added 'volatile' qualifier to all atomic pointer and
126         integer pointers.
127
128 2005-11-20  Behdad Esfahbod  <behdad@gnome.org>
129
130         * glib/guniprop.c (g_unichar_get_mirror_char): Remove unused
131         variables. (#321984, Andrew Paprocki)
132
133 2005-11-18  Matthias Clasen  <mclasen@redhat.com>
134
135         * configure.in: Bump version
136
137 2005-11-17  Matthias Clasen  <mclasen@redhat.com>
138
139         * === Released 2.9.0 ===
140
141         * glib/glib.symbols: Updates
142
143         * glib/gutf8.c (g_utf8_offset_to_pointer): Add some performance
144         hints to the docs. (Paolo Borelli)
145         
146         * NEWS: Updates
147
148         * glib/gthread.c (g_thread_foreach): Mark as new api.
149
150         * README.in: Updates.
151
152         * glib/glib.symbols: 
153         * glib/gdate.h: 
154         * glib/gdate.c (g_date_set_time_t): 
155         (g_date_set_time_val): Add functions to set a date from
156         a time_t and from a GTimeVal.
157         (g_date_set_time): Deprecate.  (#314067, Roger Leigh)
158         
159         * tests/Makefile.am:
160         * tests/utf8-pointer.c: Unit tests for g_utf8_pointer_to_offset
161         and g_utf8_offset_to_pointer.
162
163         * glib/gutf8.c (g_utf8_pointer_to_offset) 
164         (g_utf8_offset_to_pointer): Handle negative offsets, and use
165         "stutter stepping" for going backwards. (#320638, Larry
166         Ewing)
167
168         * glib/gbacktrace.c:
169         * glib/gdate.c:
170         * glib/gthread.c: const correctness fixes, found
171         by Arjan van de Ven and gcc.
172         
173 2005-11-16  Behdad Esfahbod  <behdad@gnome.org>
174
175         * docs/reference/glib/tmpl/unicode.sgml: Correct typo on mentioning
176         @G_UNICODE_BREAK_UNKNOWN that should be #G_UNICODE_BREAK_UNKNOWN.
177
178 2005-11-09  Behdad Esfahbod  <behdad@gnome.org>
179
180         * glib/guniprop.c: Use bit hacks instead when checking a general
181         category value against multiple values.
182
183         * glib/gutf8.c: Change ISO10646 to Unicode in docs.
184
185 2005-11-10  Simos Xenitellis  <simos@gnome.org>
186
187         * configure.in: Added tt (Tatar) to ALL_LINGUAS.
188
189 2005-11-05  Tor Lillqvist  <tml@novell.com>
190
191         * glib/giowin32.c (g_io_win32_set_flags): Don't call g_warning().
192         (#320688) Instead set error and return failure.
193
194 2005-11-07  Matthias Clasen  <mclasen@redhat.com>
195
196         * glib/gmain.c (g_main_dispatch): Don't call cb_funcs->unref
197         while holding the context lock.  (#320886, Andy Wingo)
198
199 2005-11-07  Billy Biggs <vektor@dumbterm.net>
200
201         * tests/refcount/Makefile.am: Add a missing reference to libglib
202         in the LDADD for this test.
203
204 2005-11-07  Matthias Clasen  <mclasen@redhat.com>
205
206         * glib/gmem.c (g_allocator_new): We need to set n_preallocs to a
207         nonzero value, otherwise GTK+ 2.8 breaks when compiled against
208         GLib 2.9.  (#320755, Luca Ferretti)
209
210 2005-11-04  Matthias Clasen  <mclasen@redhat.com>
211
212         * glib/Makefile.am: Apply a patch from Behdad Esfahbod to 
213         use a faster lookup table for g_unichar_get_mirror_char().
214         * glib/gmirroringtable.h: The new table.
215         * glib/gunichartables.h: Remove bidi_mirroring_table.
216         * glib/gen-unicode-tables.pl: Don't generate the mirroring
217         table.
218         * glib/glib-mirroring-tab/*: Sources for the program
219         which generated gmirroringtable.h.
220
221         * glib/glist.c: Avoid some code duplication.
222
223         * glib/gscanner.h: Include gdataset.h.  (#320322)
224
225         * glib/gdebug.h: add new GDebugFlag for fatal_criticals
226         * glib/gmessages.c: (_g_debug_init): handle G_DEBUG=fatal_criticals,
227         to help find critical warnings in applications.  (#320017,
228         Vincent Untz)
229
230 2005-11-02  Tor Lillqvist  <tml@novell.com>
231
232         * glib/glib.symbols: Remove large amount of trailing whitespace
233         from one line. Remove #ifdef G_UNDEFINED from around
234         g_hash_table_new and g_hash_table_new_full symbols, what was the
235         purpose of that? Add the g_slice functions.
236
237 Tue Nov  1 16:24:20 2005  Tim Janik  <timj@imendio.com>
238
239         * glib/gmem.[hc]: prepared deprecation of GMemChunk and GAllocator.
240         added g_slice_*() API to allocate and cache small bits of memory.
241         an actuall allocator implementation for g_slice_*() is still pending.
242
243         * glib/gthread.[hc]: changes from a patch by Matthias Clasen.
244         changed GRealThread list to use in-structure *next; fields instead
245         of GSList, in order for thread iteration to not depenend on g_slice_*()
246         indirectly.
247         _g_thread_mem_private_get():
248         _g_thread_mem_private_set(): added accessors for private memory,
249         needed because the ordinary GPrivate implementation relies on GArray
250         and GSList and therefore indirectly on working g_slice_*() allocations.
251
252         * glib/gthread.[hc]:
253         g_thread_foreach(): new public API function to loop over all existing threads.
254
255         * glib/gdataset.c:
256         * glib/gstring.c:
257         * glib/gcache.c:
258         * glib/garray.c: 
259         * glib/gqueue.c:
260         * glib/gslist.c:
261         * glib/glist.c:
262         * glib/ghash.c:
263         * glib/gtree.c:
264         * glib/ghook.c:
265         * glib/gmain.c:
266         * glib/gnode.c:
267         removed GAllocator and free list usages and accompanying locks.
268         use g_slice_*() API to allocate and cache small bits of memory.
269
270         * glib/ghook.h: removed GMemChunk field from public API.
271
272         * glib/gslist.h:
273         * glib/glist.h: deprecate allocator API, provide _free1() for consistency.
274
275         * glib/gnode.h: deprecate allocator API.
276
277         * glib/gmain.c: reordered GPollRec fields so g_slice_free_chain() can
278         be used for poll rec lists.
279
280         * glib/grel.c: removed mem chunk usage, and allocated tuples via g_slice_*().
281         g_relation_destroy(): free all tuples from the all_tuples hash table,
282         this effectively maintains the life time track keeping of tuples.
283         g_relation_delete_tuple(): free tuples which are removed from the
284         all_tuples hash table. this fixes a temporary leak that was present
285         in the memchunk code until the destruction of the relation.
286
287 2005-10-29  Matthias Clasen  <mclasen@redhat.com>
288
289         * tests/convert-test.c: Add some tests for conversions between
290         UTF-8, UCS-4 and UTF-16.
291
292         * glib/gutf8.c (g_utf8_to_ucs4, g_utf8_to_utf16): Fix handling
293         of len == -1, noticed by Morten Welinder.
294
295 2005-10-27  Erdal Ronahi  <erdal.ronahi@gmail.com>
296
297         * configure.in: Added ku (Kurdish) to ALL_LINGUAS
298
299 2005-10-26  Matthias Clasen  <mclasen@redhat.com>
300
301         * glib/gutf8.c (g_ucs4_to_utf8): Don't set items_read twice
302         in the error case, and add some documentation.  (#319806, Morten
303         Welinder)
304
305 2005-10-19  Manish Singh  <yosh@gimp.org>
306
307         * configure.in: Use AC_CHECK_FUNCS for _NSGetEnviron, to get the
308         config.h symbol automatically. Fixes bug #313731.
309
310 2005-10-19  Tor Lillqvist  <tml@novell.com>
311
312         * glib/gwin32.c (g_win32_get_package_installation_directory):
313         Return a g_strdup()ed copy of the value stored in the hash table,
314         so that it can be g_free()d without leaving a dangling pointer in
315         the hash table. (#319232)
316
317 2005-10-06  Matthias Clasen  <mclasen@redhat.com>
318
319         * glib/gunicollate.c (g_utf8_collate_key_for_filename): Handle
320         all-zero sequences correctly.  (#317930, Sebastien Bacher)
321
322 2005-10-05  Matthias Clasen  <mclasen@redhat.com>
323
324         * glib/gmarkup.c (g_markup_escape_text): Doc addition
325
326         * Makefile.am: Add Collation tests.
327
328         * tests/collate/*: Inputs and expected outputs for collation tests.
329
330         * tests/run-collate-tests.sh: Script to run collation tests.
331
332         * tests/unicode-collate.c (main): Rework slightly to make
333         it usable in unit tests. Also test g_utf8_collate_key_for_filename().
334
335 2005-10-01  Behdad Esfahbod  <behdad@gnome.org>
336
337         * docs/reference/glib/tmpl/unicode.sgml:
338         * glib/gen-unicode-tables.pl:
339         * glib/gunibreak.h:
340         * glib/gunichartables.h:
341         * glib/gunicode.h:
342         * tests/casefold.txt:
343         * tests/casemap.txt: Updated to Unicode 4.1.  There are five new
344         GUnicodeBreakType types.  That may break some applications, like
345         Pango <= 1.10.
346
347 2005-09-26  Matthias Clasen  <mclasen@redhat.com>
348
349         * glib/gstrfuncs.c (g_ascii_strtoull): Add details to the 
350         docs.  (#314393, Matthew F. Barnes)
351
352         * glib/glib.symbols:
353         * glib/gprintf.h: Remove g_snprintf() and g_vsnprintf(), since
354         they are already declared in glib.h. This doesn't break documented
355         use of gprintf.h, but should probably be pointed out in the 
356         release notes for 2.10. (#314232, Behdad Esfahbod)
357
358 Tue Sep 20 13:16:04 2005  Tim Janik  <timj@imendio.com>
359
360         * glib/gpattern.c (g_pattern_ph_match): applied significant recursion
361         complexity optimization, based on a patch from Matthias Clasen.
362
363         * tests/patterntest.c: more tests, mostly from matthias.
364
365 2005-09-20  Matthias Clasen  <mclasen@redhat.com>
366
367         * glib/gqueue.c (g_queue_insert_sorted): Correct the docs.
368         (#316703, Mark Drago)
369
370 Mon Sep 19 17:23:23 2005  Tim Janik  <timj@imendio.com>
371
372         * glib/gpattern.c: applied a patch from matthias which checks on the
373         upper bound of GPatternSpec length to optimize matches.
374         cosmetic fixups.
375
376         * tests/patterntest.c: added more match cases.
377
378 2005-09-16  Tor Lillqvist  <tml@novell.com>
379
380         * glib/gstrfuncs.c (g_ascii_strcasecmp, g_ascii_strncasecmp): Add
381         warning to doc comment that these functions should not be used on
382         encodings like CP932.
383
384 2005-09-14  Matthias Clasen  <mclasen@redhat.com>
385
386         * tests/keyfile-test.c: Add a test for grup names of length 1.
387
388         * glib/gkeyfile.c (g_key_file_line_is_group): Accept group names
389         of length 1.  (#316309)
390         
391 2005-09-12  Matthias Clasen  <mclasen@redhat.com>
392
393         * glib/gmarkup.c (g_markup_escape_text): Clarify docs.
394
395 2005-09-11  Sebastian Wilhelmi  <seppi@seppi.de>
396
397         * tests/refcount/Makefile.am (INCLUDES): Link the the refcount
398         tests to the system thread library $(G_THREAD_LIBS). Fixes #313744
399         and #314217.
400
401 2005-09-11  Kjartan Maraas  <kmaraas@gnome.org>
402
403         * glib/gmain.c: (g_child_watch_prepare), (g_child_watch_check),
404         (child_watch_helper_thread): Remove some dead code. Closes
405         bug #315278.
406
407 2005-09-07  Tor Lillqvist  <tml@novell.com>
408
409         * glib/Makefile.am: Create also a console version of the
410         gspawn-win32-helper program, gspawn-win32-helper-console.exe.
411         It's otherwise identical to gspawn-win32-helper.exe, except marked
412         as a console application (linked without the -mwindows option).
413         
414         * glib/gspawn-win32.c (do_spawn_directly, do_spawn_with_pipes):
415         Drop the dont_wait parameter. Its truth value correlated 100% with
416         the NULLness of the exit_status parameter anyway, so it's enough
417         to check whether exit_status is NULL. Invert the sense of the
418         dont_return_handle parameter and rename it to do_return_handle, to
419         make the code easier to read by avoiding double negations.
420
421         (g_spawn_sync_utf8, g_spawn_async_with_pipes_utf8): Modify calls
422         to do_spawn_with_pipes() accordingly.
423
424         (do_spawn_with_pipes): If we have a console, use the console
425         version of the helper program, otherwise use the GUI one. This
426         avoids extra console windows opening up in some situations. (In
427         case a console application uses the GUI gspawn-win32-helper.exe to
428         spawn another console application we would get a separate console
429         for the spawned console application).
430
431         * glib-zip.in: Distribute also gspawn-win32-helper-console.exe.
432
433 2005-09-05  Matthias Clasen  <mclasen@redhat.com>
434
435         * glib/gmappedfile.c (g_mapped_file_new): Report an error
436         if the file is too large.  (#315275, Kjartan Maraas)
437
438         * glib/gkeyfile.c (g_key_file_load_from_fd): The return value
439         of read() is signed.  (#315273, Kjartan Maraas)
440         
441 2005-08-31  Tor Lillqvist  <tml@novell.com>
442
443         * glib/gutils.h: Wrapping atexit() is a bad idea on Windows, where
444         the EXE and each DLL have their own atexit function chains.
445
446         #define g_atexit as atexit instead. This means it has a
447         better chance of doing what the caller wants. For instance,
448         gtkhtml calls g_atexit() registering a function in gtkhtml
449         itself. This caused a crash when g_atexit() was implemented as a
450         function in the GLib DLL. The gtkhtml DLL was already unloaded by
451         the time the GLib DLL got unloaded.
452
453         * glib/gutils.c: #undef the #define mentioned above, to also get a
454         real g_atexit() into the DLL for backward compatibility. Document
455         the Windows behaviour of g_atexit(), and document the varying ways
456         atexit() can behave in the context of dynamically loaded modules
457         on Unix.
458
459 2005-08-31  Matthias Clasen  <mclasen@redhat.com>
460
461         * glib/glib.symbols: 
462         * glib/gquark.h: 
463         * glib/gdataset.c: Add string interning functions.
464
465 2005-08-28  Matthias Clasen  <mclasen@redhat.com>
466
467         * glib/giochannel.c: Unify some near-duplicate strings. (#314654,
468         Clytie Siddall)
469         
470 2005-08-26  Matthias Clasen  <mclasen@redhat.com>
471
472         * configure.in: Bump version to 2.9.0
473
474 2005-08-25  Tor Lillqvist  <tml@novell.com>
475
476         Make also the g_spawn*() functions take parameters in the GLib
477         file name encoding, i.e. UTF-8, on Windows. Has no impact on Unix
478         API or ABI. Like the other GLib API that was earlier changed to
479         use UTF-8 on Windows, the names of the functions that take UTF-8
480         have _utf8 suffixes added by using preprocessor macros in the
481         header file. The old names are kept for functions with the old
482         behaviour, taking parameters in the system codepage, for DLL ABI
483         stability.
484         
485         * glib/gspawn.h: On Win32 add the suffix _utf8 to the names of the
486         g_spawn*() functions.
487         
488         * glib/gspawn-win32.c: Use wide-char API on NT-based
489         Windows. Convert parameters from UTF-8 to wide chars (NT) or
490         system codepage (Win9x) and call the C library _wspawn*() or
491         spawn*() functions respectvely. Add DLL ABI stability versions
492         that take parameters in the system codepage.
493
494         * glib/gspawn-win32-helper.c: On NT-based Windows use the
495         wide-char versions of argv and envp, and use wide-char API to
496         change directory and spawn the program to run. Remove the verbose
497         debugging output, it was too complex to modify for the wide-char
498         features. (Just add temporary debugging printouts if needed, no
499         need to have them permanently in the source.)
500
501         * glib/gspawn.c: Corresponding documentation updates.
502
503         * glib/glib.symbols: Corresponding changes: Mark the ABI stability
504         symbols as PRIVATE, add the new _utf8-suffixed ones.
505
506 2005-08-24  Stepan Kasal  <kasal@ucw.cz>
507
508         * glib/gtypes.h (G_MININT64): Cast the constant to gint64; it is
509         guint64 otherwise and that can produce warnings about comparison
510         between signed and unsigned.
511
512 2005-08-23  Matthias Clasen  <mclasen@redhat.com>
513
514         * glib/gutils.c: Fix the crt_externs.h include.
515
516 2005-08-23  Stepan Kasal  <kasal@ucw.cz>
517
518         * NEWS: Fix spelling of my first name.
519
520 2005-08-23  Matthias Clasen  <mclasen@redhat.com>
521
522         * Bump version
523
524         * === Released 2.8.1 ===
525
526         * NEWS: Updates
527
528 2005-08-20  Hans Breuer  <hans@breuer.org>
529
530         * glib/makefile.msc.in : link with ws2_32.lib
531
532 2005-08-18  Tor Lillqvist  <tml@novell.com>
533
534         * configure.in: Check for <sys/wait.h>
535
536         * glib/gbacktrace.c: Include <sys/wait.h> on if HAVE_SYS_WAIT_H.
537
538 2005-08-18  Ross Burton  <ross@burtonini.com>
539
540         * glib/gstring.c:
541         Optimise single-character insertions.
542         
543         * glib/gutf8.c:
544         Note copied code.
545         
546         * tests/string-test.c:
547         Add tests for new optimisation, and fix a leak.
548
549 2005-08-17  Matthias Clasen  <mclasen@redhat.com>
550
551         * configure.in: Check for crt_externs.h and _NSGetEnviron.
552
553         * glib/gutils.c: On Darwin, include crt-externs.h and
554         define environ using _NSGetEnviron().  (#313731)
555
556 2005-08-16  Stepan Kasal  <kasal@ucw.cz>
557
558         * glib/gutils.c (g_get_any_init): Move the body of the big if...
559         (g_get_any_init_do): ... to this new function.
560         (g_get_any_init): Declare as inline.
561         (g_get_any_init_locked): New inline function, does the locking.
562         Make use of these two throughout the code.
563
564 2005-08-15  Matthias Clasen  <mclasen@redhat.com>
565
566         * glib/gbacktrace.c (g_on_error_stack_trace): Wait for
567         the child process and then simply return. This makes 
568         The "S" option work as documented in g_on_error_query().
569         (#313125, Matthew F. Barnes)
570
571         * glib/gunicode.h: Update the link to Unicode category
572         values.  (#313369, Behnam Esfahbod)
573
574         * glib/gqueue.c (g_queue_find_custom): Clarify docs
575         a little.  (#311727, Tristan van Berkom)
576
577         * glib/abicheck.sh, gobject/abicheck.sh: Make the 
578         check work on ia64 too, where some symbols ended up 
579         in yet another section.
580