chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] [REPOST] Make temporary stack resizable (f


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] [REPOST] Make temporary stack resizable (fixes #1098)
Date: Mon, 15 Aug 2016 21:52:26 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jan 14, 2016 at 09:19:19PM +0100, Peter Bex wrote:
> On Sat, Oct 31, 2015 at 08:19:44PM +0100, Peter Bex wrote:
> > So, here we go, a patch to dynamically resize the temporary stack.
> 
> Even mentioned on IRC that it may be useful to have the current
> behaviour (a fixed temp stack size), but with resizing as the default
> behaviour.
> 
> Attached is a new version of the patch which allows one to restore
> the old behaviour by passing -:A, which sets a fixed temporary stack.

Here's a re-post of said patch, after fixing it to apply to latest
versions of chicken-5.  I've also done it for master, in light of
the bug report by Samadi van Koten; in CHICKEN 4.10 and earlier,
we simply used to raise a "apply-limit exceeded" exception.

With this patch, CHICKEN no longer borks via an assertion failure.
Instead, it will either loop forever if the stack itself is too
small, it will raise a proper Scheme exception if the temporary
stack is set to a fixed size that's not large enough, or, if the
the stack is big enough and the temp stack is either large enough
or may be resized.

If y'all agree this is better behaviour, we could also consider
attempting to detect the situation where the stack isn't large
enough to hold a rest list, and either 1) allocate on the heap,
2) do something else clever to avoid this being a problem, 3)
detect the situation and 3a) resize the stack (can that be done?)
or 3b) raise an Scheme-level exception to signal the limitation
has been exceeded, possibly hinting at the -:s option.

Cheers,
Peter

Attachment: 0001-Dynamically-resize-temporary-stack-when-needed.chicken-5.patch
Description: Text Data

Attachment: 0001-Dynamically-resize-temporary-stack-when-needed.master.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

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