gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: unrecoverable error during (I think) SGC


From: Camm Maguire
Subject: [Gcl-devel] Re: unrecoverable error during (I think) SGC
Date: 17 Jan 2008 08:21:13 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi Matt!

Indeed a bug.  I'll be away for a week with my laptop, and will try to
address this by the time I get back.

flet code build a closure on each call, which consumes memory.  The
code in fact is tail recursive, which need not.  Now that 2.7 does
automatic inlining, I'm tempted to have flet and labels be inlined
automatically by default.  Is there some reason a user writing flet
would want a genuine function call with each iteration?  Tracing
without fast-links, perhaps?

As before mentioned in a gcl-devel post, I'm also working on passive
list referencing and dereferencing.  In brief, with our source
inlining, 

(append x y z)

goes to

(let* ((xx x) (yy y) (zz z) (append-rest (list* xx yy zz)) inline append source)

The list is consed on the C stack, avoiding gc overhead, as the append
source includes a :dynamic-extent declaration.  The weakness is that
type information on x y and z are lost when referenced as the car of
some list.  Right now I have a working experimental version which
carries this information in cons types, and which I believe can be
made acceptably fast.  In addition, or perhaps instead, I'd like to
engineer a passive reference of such a list which would revert to the
original variable.  The list, being then unreferenced, would never be
stack-consed in the first place.

Thouhts most welcome.

Take care,

Matt Kaufmann <address@hidden> writes:

> Hi, Camm --
> 
> Normally I find that GCL prints friendly messages like this when it
> runs out of space:
> 
> Error: The storage for BIGNUM is exhausted.
>        Currently, 68 pages are allocated.
>        Use ALLOCATE to expand the space.
> 
> However, here is an example in which I get an unrecoverable error, the
> statement of which depends on the version of GCL (as shown below).
> 
> ==============================
> 
> (declaim (optimize (speed 3) (space 0) (safety 0)))
> (si::sgc-on t)
> (defun fact (n acc)
>   (flet ((fact0 (n acc)
>                 (if (zerop n)
>                     acc
>                   (fact (1- n)
>                         (* n acc)))))
>     (return-from fact (fact0 n acc))))
> (compile 'fact)
> (zerop (fact 50000 1))
> 
> ==============================
> 
> For /u/camm/test/gcl2/bin/gcl [a 2.7.0 I found lying around]:
> 
> Warning: attempting tight relocatable GC
> 
> Unrecoverable error: not enough room to gc relblock.
> Abort
> 
> ==============================
> 
> For /p/bin/gcl-2.6.7 [GCL 2.6.7]:
> 
> Unrecoverable error: Pages out of range in make_writable.
> Abort
> 
> ==============================
> 
> By the way, the error disappears if I manually remove the flet:
> 
> (defun fact (n acc)
>   (return-from fact (if (zerop n)
>                       acc
>                     (fact (1- n)
>                           (* n acc)))))
> 
> Thanks --
> -- Matt
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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