tech-kern archive

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

Re: valgrind



On Tue 22 Mar 2022 at 17:46:49 +0000, Koning, Paul wrote:
> I don't believe ALGOL implementations needed executable stacks to implement nested functions, for example.

No, a common way to do it (as in the Dragon Book), if I recall
correctly, the address of the function combined with a stack frame
pointer. And nested functions keep a static link to the lexically
enclosing scope, or alternatively a "display". I'm not sure if A68 would
automatically move locals from surrounding scopes into the heap (like in
a closure); it could well be that there was run-time checking instead if
you tried to use a function pointer outside of the scope of any of the
locals it used.

But these sorts of strategies require bigger function pointers, which
you basically can't do in C.

> 	paul
-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index