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