On Wed, Oct 23, 2002 at 11:23:26PM -0400, Josh Wilmes wrote: > I've got a patch which switches this detection to happen at run-time > instead of at build-time. This is going to be necessary for miniparrot > (which has no "Configure" step) anyway.
Have you checked how much this affects the performance of stack walking ? The current stack direction tests make the stack direction a compile time constant, so that the compiler can optimize away the multiplications in the stack walking loop which can be pretty expensive. The original stack direction tests were run-time, and I changed them to be done at configure time to simplify doing them in a more correct way while also making the code faster. One way of simplifying things here is to always walk the stack in the same direction (lowest address to higher address), and swap the lo and high pointer as the start and end points of the loop. This eliminates the need for an explicit stack growth direction test. One thing that will still remain is that the garbage collector must know the CPU instruction set so it can use the appropriate means to locate pointers in registers. I'm not sure if this can be done by testing for preprocessor symbols alone. -- Jason