On 21 May 2012 23:16, Nikodemus Siivola <nikodemus@...> wrote:
> On 21 May 2012 19:00, Nikodemus Siivola <nikodemus@...> wrote:
>>> Does it mean that
>>> (define-condition once-again () ())
>>> (prog ((+once-again+ (make-condition 'once-again))
>>> (n 1000000))
>>> (handler-bind ((once-again #'(lambda (c)
>>> (declare (ignore c))
>>> (go :again))))
>>> (unless (zerop (decf n))
>>> (error +once-again+))))
>>> now runs in nearly constant space?
> After those (TYPEP CONDITION (CAR HANDLER)) seems to be the last
> source of consing in SIGNAL, aside from the &REST list allocation
> which doesn't matter here.
Amusingly, it turned out that the TYPEP consing came from NLX value
cells as well. Rudimentary escape analysis is enough to sort this out.
I already committed the SIGNAL improvements, but would much appreciate
it if someone could find the time to review this one before I commit
it. I keep having the feeling I'm missing something obvious.
Non-loadable patch attached, apply on top of
9bc5da72887b15eb83500e16f05c3e42835476a3 or later.
With that setup, the example above should run without consing.