Commit Graph

23 Commits

Author SHA1 Message Date
Matthew Barnes
cc3e80c26a Add G_QUEUE_INIT, g_queue_init(), and g_queue_clear() to better support
2007-03-06  Matthew Barnes  <mbarnes@redhat.com>

	* glib/gqueue.h:
	* glib/gqueue.c: Add G_QUEUE_INIT, g_queue_init(), and
	g_queue_clear() to better support statically allocated
	queues.  (#413244)


svn path=/trunk/; revision=5378
2007-03-06 18:43:10 +00:00
Tim Janik
0cba1b531d prepared deprecation of GMemChunk and GAllocator. added g_slice_*() API to
Tue Nov  1 16:24:20 2005  Tim Janik  <timj@imendio.com>

        * glib/gmem.[hc]: prepared deprecation of GMemChunk and GAllocator.
        added g_slice_*() API to allocate and cache small bits of memory.
        an actuall allocator implementation for g_slice_*() is still pending.

        * glib/gthread.[hc]: changes from a patch by Matthias Clasen.
        changed GRealThread list to use in-structure *next; fields instead
        of GSList, in order for thread iteration to not depenend on g_slice_*()
        indirectly.
        _g_thread_mem_private_get():
        _g_thread_mem_private_set(): added accessors for private memory,
        needed because the ordinary GPrivate implementation relies on GArray
        and GSList and therefore indirectly on working g_slice_*() allocations.

        * glib/gthread.[hc]:
        g_thread_foreach(): new public API function to loop over all existing threads.

        * glib/gdataset.c:
        * glib/gstring.c:
        * glib/gcache.c:
        * glib/garray.c:
        * glib/gqueue.c:
        * glib/gslist.c:
        * glib/glist.c:
        * glib/ghash.c:
        * glib/gtree.c:
        * glib/ghook.c:
        * glib/gmain.c:
        * glib/gnode.c:
        removed GAllocator and free list usages and accompanying locks.
        use g_slice_*() API to allocate and cache small bits of memory.

        * glib/ghook.h: removed GMemChunk field from public API.

        * glib/gslist.h:
        * glib/glist.h: deprecate allocator API, provide _free1() for consistency.

        * glib/gnode.h: deprecate allocator API.

        * glib/gmain.c: reordered GPollRec fields so g_slice_free_chain() can
        be used for poll rec lists.

        * glib/grel.c: removed mem chunk usage, and allocated tuples via g_slice_*().
        g_relation_destroy(): free all tuples from the all_tuples hash table,
        this effectively maintains the life time track keeping of tuples.
        g_relation_delete_tuple(): free tuples which are removed from the
        all_tuples hash table. this fixes a temporary leak that was present
        in the memchunk code until the destruction of the relation.
2005-11-01 18:10:31 +00:00
Matthias Clasen
3fef89349b Doc fixes 2005-09-20 05:50:24 +00:00
Matthias Clasen
95ffa1e5af Clarify docs a little. (#311727, Tristan van Berkom)
2005-08-15  Matthias Clasen  <mclasen@redhat.com>

	* glib/gqueue.c (g_queue_find_custom): Clarify docs
	a little.  (#311727, Tristan van Berkom)
2005-08-15 18:28:12 +00:00
Matthias Clasen
608a31b98e Make PLT-reduction work with gcc4, and don't include everything in
2005-03-13  Matthias Clasen  <mclasen@redhat.com>

	Make PLT-reduction work with gcc4, and don't include
	everything in galias.h:

	* glib/glib.symbols: Group symbols by header and source file.
	* glib/makegalias.pl: Protect definitions by the same
	preprocessor symbols used to guard the headers. Move
	the alias declarations to a separate file which is
	produced when calling makegalias.pl -def
	* glib/Makefile.am (galiasdef.c): Add a rule to generate this
	file.
	* glib/*.c: Include galias.h after the other GLib headers,
	include galiasdef.c at the bottom.
2005-03-14 04:26:57 +00:00
Matthias Clasen
0e2279a092 Use a memchunk for sizeof(GQueue)-sized chunks. (#167984, Fabrício Barros
2005-02-20  Matthias Clasen  <mclasen@redhat.com>

	* glib/gqueue.c (g_queue_new): Use a memchunk for
	sizeof(GQueue)-sized chunks.  (#167984, Fabrício Barros Cabral)
2005-02-21 04:35:29 +00:00
Matthias Clasen
bd177ce103 Return -1 if queue is NULL. (#159530, Philippe Blain)
2004-12-04  Matthias Clasen  <mclasen@redhat.com>

	* glib/gqueue.c (g_queue_link_index): Return -1 if queue is
	NULL.  (#159530, Philippe Blain)
2004-12-04 18:32:54 +00:00
Matthias Clasen
dafdffd751 Implement the same PLT reduction technique used in GTK+:
Thu Sep 16 02:03:15 2004  Matthias Clasen  <maclas@gmx.de>

	Implement the same PLT reduction technique used in GTK+:
2004-09-16 06:05:53 +00:00
Matthias Clasen
2efb5e1cd8 Add some tests for off-by-one errors.
2004-04-22  Matthias Clasen  <mclasen@redhat.com>

	* tests/queue-test.c (main): Add some tests for off-by-one errors.

	* glib/gqueue.c (g_queue_pop_nth_link): Fix an off-by-one
	error.  (#139703, Philippe Blain)
2004-04-22 20:51:07 +00:00
Matthias Clasen
3ce97fa284 Documentation updates. 2004-02-27 21:11:51 +00:00
Soeren Sandmann
e21dadd6f3 Some documentation fixes.
Sat Feb 21 15:42:39 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* glib/gqueue.c: Some documentation fixes.
2004-02-21 14:58:09 +00:00
Soeren Sandmann
a9bbf0f35d Extend GQueue API to match the GList API. (#118439).
Sat Feb 21 13:45:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* glib/gqueue.[ch]: Extend GQueue API to match the GList
	API. (#118439).

	* tests/queue-test.c: Update test suite to cover the new API.
2004-02-21 12:48:08 +00:00
Owen Taylor
bbbd329ff5 Patch from Sven Neumann to make the include order consistent. (#71704)
Tue Dec  3 20:22:27 2002  Owen Taylor  <otaylor@redhat.com>

        * glib/*.c: Patch from Sven Neumann to make the
        include order consistent. (#71704)
2002-12-04 01:27:44 +00:00
Soeren Sandmann
d201974f56 Trivial s/foo/foo_/ fixes to make <glib.h> includable with -Wshadow
Fri Nov  8 19:44:20 2002  Soeren Sandmann  <sandmann@daimi.au.dk>

	* docs/reference/glib/tmpl/arrays.sgml:
	* docs/reference/glib/tmpl/arrays_byte.sgml:
	* docs/reference/glib/tmpl/arrays_pointer.sgml:
	* docs/reference/glib/tmpl/date.sgml:
	* docs/reference/glib/tmpl/linked_lists_double.sgml:
	* docs/reference/glib/tmpl/linked_lists_single.sgml:
	* docs/reference/glib/tmpl/main.sgml:
	* docs/reference/glib/tmpl/queue.sgml:
	* docs/reference/glib/tmpl/random_numbers.sgml:
	* docs/reference/glib/tmpl/relations.sgml:
	* docs/reference/glib/tmpl/scanner.sgml:
	* docs/reference/gobject/tmpl/gtype.sgml:
	* docs/reference/gobject/tmpl/value_arrays.sgml glib/garray.h:
	* glib/gdate.h glib/giochannel.h glib/glist.h glib/gmain.c:
	* glib/gmain.h glib/gqueue.c glib/gqueue.h glib/grand.c glib/grand.h:
	* glib/grel.h glib/gslist.h glib/gtimer.h gobject/gvaluearray.h:

	Trivial s/foo/foo_/ fixes to make <glib.h> includable with
	-Wshadow without warnings (#91680)
2002-11-08 18:47:56 +00:00
Matthias Clasen
d761fb4b3b documentation update. add documentation. update docs. Remove references to
* glib/gstrfuncs.c, glib/giochannel.c: documentation update.
        * glib/gqueue.c: add documentation.
        * glib/tmpl/iochannel.sgml, glib/tmpl/macros_misc.sgml,
          glib/tmpl/queue.sgml: update docs.
        * glib/tmpl/modules.sgml, glib/tmpl/threads.sgml: Remove
          references to glib-config.
2001-10-02 23:09:51 +00:00
Sebastian Wilhelmi
2fb47703e2 Ok, I'm a moron. When I originally implemented ENABLE_GC_FRIENDLY, I
2000-12-19  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gslist.c, glist.c: Ok, I'm a moron. When I originally
	implemented ENABLE_GC_FRIENDLY, I forgot to include config.h into
	the affected files. Now that Alex did that for those two,
	inevitable typos surfaced, which are now fixed.

	* garray.c, ghash.c, gqueue.c, gtree.c: Include config.h as well,
	as ENABLE_GC_FRIENDLY should be known.
2000-12-19 15:40:30 +00:00
Tim Janik
c9bd7542e1 applied patch from Andreas Persenius <ndap@swipnet.se> that updates the
Wed Jul 26 12:59:31 2000  Tim Janik  <timj@gtk.org>

        * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that
        updates the license headers to the GNU Lesser General Public License,
        as well as updating the copyright year to 2000.
2000-07-26 11:02:02 +00:00
Sebastian Wilhelmi
8c90d7766b Add configure test for garbage collector friendliness for GLib. If
2000-04-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* configure.in, acconfig.h: Add configure test for garbage
	collector friendliness for GLib. If enabled, ENABLE_GC_FRIENDLY
	will be defined.

	* garray.c, ghash.c, glist.c, gmain.c, gmem.c, gnode.c, gqueue.c,
	gslist.c, gtree.c: If ENABLE_GC_FRIENDLY is defined, NULLify all
	memory released by the user, but cached by GLib. This lets a
	garbage collector have a more correct view of the actually used
	memory.
2000-04-17 13:23:27 +00:00
Sebastian Wilhelmi
8f02fac4ad Renamed g_queue_create to g_queue_new in conformance to all other GLib
2000-04-17  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* glib.h, gqueue.c, tests/queue-test.c (main): Renamed
	g_queue_create to g_queue_new in conformance to all other GLib
	data types.
2000-04-17 10:31:10 +00:00
Sebastian Wilhelmi
3540769b17 We want the next and prev pointer of the inserted link to be NULL.
2000-03-13  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gqueue.c (g_queue_push_tail_link, g_queue_push_head_link): We
	want the next and prev pointer of the inserted link to be NULL.
2000-03-13 16:49:40 +00:00
Tim Janik
87c7aeb93b 18:36. incorporated proposed cleanups from gtk-devel-list.
Sat Jul 24 20:11:35 1999  Tim Janik  <timj@gtk.org>

        * merged GLib 1.3.0 with glib-1.2.3 from Fri Jul 16 22:18:36.
        * incorporated proposed cleanups from gtk-devel-list.

        * bumped version number to GLib-1.3.1

        * glib.h:
        * gqueue.c:
        * gstring.c:
        * glist.c:
        removed string tokenisation (we got g_strsplit() and g_strjoin()
        already) and readline functions.
        s/g_list_delete/g_list_delete_link.
        implemented g_slist_delete_link.
        removed notion of g_ATEXIT() macro in glib.h, this is an *internal*
        macro, g_atexit() is provided for public consumption.
        added GTrashStack inline utility functions.
        reimplement double eneded queues.
        removed GStack implementation, people can use a queue or a (singly)
        linked list for this task.
        deprecated g_strescape(), we need the SunOS variants here.

        * gdate.c: added DEBUG_MSG() macro to wrap old messages.

        * *.*: CVS merges.

        * upgrade to libtool 1.3.3.
1999-07-24 18:50:58 +00:00
Jeff Garzik
05f42cc0e2 Add copyright, clean up code a bit.
1999-03-17  Jeff Garzik  <jgarzik@pobox.com>

        * gstack.c, gqueue.c:
        Add copyright, clean up code a bit.
1999-03-17 15:38:18 +00:00
Jeff Garzik
fd7ba69e32 Added stack, queue ADTs and related tests.
Tue Mar  9 14:37:32 1999  Jeff Garzik  <jgarzik@pobox.com>

        * Makefile.am, glib.h, gstack.c, gqueue.c,
          tests/Makefile.am, tests/queue-test.c, tests/stack-test.c:
        Added stack, queue ADTs and related tests.

        * glib.h, glist.c:
        New g_list_delete() function.
1999-03-09 19:41:19 +00:00