CVS update: gnucash/src/engine

Linas Vepstas linas@linas.org
Tue, 4 Dec 2001 07:55:46 -0600


On Mon, Dec 03, 2001 at 11:04:03PM -0800, Dave Peticolas was heard to remark:
> On Mon, 2001-12-03 at 22:46, Linas Vepstas wrote:
> > 
> > Date:	Tuesday December 4, 2001 @ 0:46
> > Author:	linas
> > 
> > Update of /home/cvs/cvsroot/gnucash/src/engine
> > In directory www.linas.org:/tmp/cvs-serv25744
> > 
> > Modified Files:
> > 	Group.c GroupP.h 
> 
> You do realize that the sub-account lister function
> used g_list_prepends and then a reverse for efficiency,
> right? Using g_list_append is O(n^2) for building up
> a list.

What you say is true for GSList, which is singly-linked.

But GList is doubly-linked, so an append is same speeed as 
a prepend.  I guess it uses a few more cycles to set the 
second pointer, and does use more memory ... but should 
still be faster than reversing.

-- linas

p.s. what is the deal with running the tests?  They all crash. 
If I just cd src/engine/test and run a test, I get 

GLib-CRITICAL **: file gmem.c: line 563 (g_mem_chunk_alloc): assertion
`mem_chunk != NULL' failed.
Segmentation fault

#0  0x400baddc in scm_igc () from /usr/lib/libguile.so.9
#1  0x400bad63 in scm_gc_for_newcell () from /usr/lib/libguile.so.9
#2  0x400e02ff in scm_makstr () from /usr/lib/libguile.so.9
#3  0x400e0533 in scm_makfromstr () from /usr/lib/libguile.so.9
#4  0x400e0590 in scm_makfrom0str () from /usr/lib/libguile.so.9
#5  0x400e28d9 in scm_eval_0str () from /usr/lib/libguile.so.9
#6  0x400be78e in gh_eval_str () from /usr/lib/libguile.so.9
#7  0x400701a7 in gnc_engine_commodity_table_new () at engine-helpers.c:55
#8  0x4003db8c in gnc_book_init (book=0x8050148) at gnc-book.c:93
#9  0x4003dbf1 in gnc_book_new () at gnc-book.c:107
#10 0x0804b33c in run_test () at test-period.c:34
#11 0x0804b3c7 in main (argc=1, argv=0xbffffa94) at test-period.c:57
#12 0x4019765f in __libc_start_main () from /lib/libc.so.6


Is there some special framework that sets up environment variables 
for these tests ??



> 
> dave
> 



-- 
pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas@linas.org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933