Use of complete GList functionality? Change to GSList?

Dave Peticolas dave@krondo.com
Sun, 04 Mar 2001 13:07:02 -0800


Derek Atkins writes:
> Hi,
> 
> I was wondering if we're really using GList's full functionality
> everywhere, and if not, if we could switch those places to a GSList?
> 
> I'm currently working on an RPC Backend storage system for Gnucash.
> One of the "problems" is that I basically have to completely copy the
> data structures.  That alone isn't so bad, but I'd like to try to make
> the RPC structures match the 'normal' structures, so I don't have to
> perform an alloc/copy/free for every RPC operation.

GLists are allocated with the glib memory routines. You cannot mix
them with the libc routines. Any engine structures that the RPC
backend creates needs to use glibc memory routines if they are used
for that in the engine. Is RPC going to be able to handle that?


> The problem is that while RPC can handle a linked list, at cannot
> handle a doubly-linked list.  Therefore, anything that is using a
> GList just plain loses in terms of building an RPC structure that
> matches.  If, however, we used GSLists, then I could easily build an
> RPC equivalent.

Why? If it's just for storage you can store it as a singly-linked
list and fix it up when you load it.

dave