I swear I'm not making this up.
I swear I'm not making this up.
The original Torvalds quote in context:
>"When I started the whole design, started doing programming in user space, which I had not done for 15 years, it was like, wow, this is so easy. I don't need to worry about all these things, I have infinite stack, malloc just works. But in the kernel space, you have to worry about locking, you have to worry about security, you have to worry about the hardware.
http://opendotdotdot.blogspot.com/2014/01/interview-linus-to...
We spent a lot if money to purchase MacCLint but it overflowed the stack by megabytes and so corrupted the heap. The author wasnt receptive of my advice to remove all its recursion, he asserted rcursion is necessary for compiler-like programs.
Recursive algorithms di not require recursive implementations. The pricedure fir converting recursion to iteration is documented by Robert Sedgewick in "Algorithms".
Really you do have a stack but its not the runtime stack.
MacCLint was a piece of work; I would be unsurprised were it to have local variables that were megabytes in size.
That is I don't know the depth of recursion but I do know that it blew out the 32 kB limit by megabytes.
MacCLint is also the reason why I always use explicit returns in C-like languages. It would crash - which on Mac OS System 7 would drop my box into MacsBug - if I just fell off the end of a void function.
Dave Johnson, the owner of Working Software, had already advised me to use explicit returns because he once used a compiler that generated incorrect machine code if he didn't do so.
Even without buggy tools explicit returns are handy for setting breakpoints. Some debuggers enable you to break just before return even if you fall off the end but not all do.
Isn't falling off a void function the same as returning from it?
And of course, initially, classic Mac OS didn't have 32kB of stack on original hardware. It didn't even have 32kB available to applications.
I expect the System always ensured that DAs could have 8 kB of stack on top of whatever the application had; that is, app+DA defaulted to 40 kB.
MacCLint was such a skanky program I don't think it would have done it a whole lot of good to increase the stack.