On Mon, Apr 21, 2008 at 08:48:10PM +0100, Klaas-Jan Stol wrote: > On Mon, Apr 21, 2008 at 8:25 PM, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > > I think we'd get a BIG win if we changed the dynamic_env stack to > > have an approach similar to ResizableIntegerArray, where we allocate > > arrays of Stack_Chunk entries and manage them that way, instead of > > a separate allocation per element in the stack. > > what about actually using a ResizableIntegerArray for this purpose? > (or PMC, if Integer is not suitable for storing addresses) > Or is this a really dumb idea?
I looked at this possibility, and while it can work, the values that need to be stored are actually pointers, not integers. We could do some casting there, but I think it'd be a slight step sideways, when we can do much better (in an area that needs to be as good as we can make it). ResizablePMCArray is probably even farther afield, since the things being stored aren't at all PMCs. But truthfully I'm thinking I can eliminate much of the existing stack_* code altogether. At the moment the stack_* functions are trying to manage a stack that contains integers, floats, strings, pmcs, and addresses. I'm thinking that if we eliminate the user_stack ops, then we just need a stack of addresses, which means we can rip out a metric ton of existing code. Pm