[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] library constants

From: Alex Shinn
Subject: [Chicken-users] library constants
Date: Tue, 09 Nov 2004 02:18:08 -0600
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)

I currently have a library which is just a collection of constant
char-sets - the file is about 65kb and the compiled library is about

The definitions are all of the form:

  (define char-set:foo
    (moderately-expensive-computation ...))

If I use

  (define-constant char-set:foo ...)

then even though char-set:foo is declared as an export no code is
generated for it and it gets left out of the library.

However, if i do

  (define-constant %char-set:foo ...)

  (define char-set:foo %char-set:foo)

then char-set:foo is not only included in the library, but it is
generated by directly creating the record construct on the heap, so
there are no procedure calls at loadtime, resulting in a smaller and
faster library.

Unfortunately, if I define _all_ the char-sets this way the
compilation for some reason requires much more memory and fails with
the following error:

cc1: out of memory allocating 285658208 bytes after a total of 21295104 bytes

Is this a reasonable approach to creating fast-loading libraries and
if so why does it require so much more memory to compile?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]