[armedbear-devel] (lisp) Stack management efficiency
Alessio Stalla
alessiostalla at gmail.com
Tue Jul 21 12:59:31 UTC 2009
On Tue, Jul 21, 2009 at 2:21 PM, Ville
Voutilainen<ville.voutilainen at gmail.com> wrote:
>>>> 2) chunked-allocated (set aside a bunch, when all are unwound, remove
>>>> a chunk, before that, mark them unused for re-use)
>> I like that idea. We have no idea about a "normal" stack depth do we?
>
> Not really. This depends on how big our frame objects are, I think.
>
>> In that case, especially since the overhead of a single pointer seems
>> small, we should probably use a number a bit large (like 4k?), until
>> people start to complain?
>
> Four thousand frames per chunk? Sounds a bit large off-hand.
How does the Lisp stack relate to the Java stack, if they're related
at all? I don't know the maximum number of stack frames in Java, maybe
it's not even fixed, but I doubt I have ever seen stack traces longer
than a few hundred frames.
>> I think the right structure to use for (2) would be a linked list of
>> arrays. (How about using Conses to store it?)
>
> Yeah, that sounds doable.
Conses can only store LispObjects IIRC, and thus an array would need
to be wrapped... there's java.util.Stack since 1.4.2, that extends
Vector, that might do?
More information about the armedbear-devel
mailing list