[TUHS] Memory management in Dennis Ritchie's C Compiler

Arthur Krewat krewat at kilonet.net
Wed Aug 26 09:06:04 AEST 2020


On 8/24/2020 1:20 PM, Dan Cross wrote:
> On Mon, Aug 24, 2020 at 1:08 PM John Cowan <cowan at ccil.org 
> <mailto:cowan at ccil.org>> wrote:
>
>     On Mon, Aug 24, 2020 at 12:00 PM Dan Cross <crossd at gmail.com
>     <mailto:crossd at gmail.com>> wrote:
>
>         Stacks may be at the top of the user portion of the address
>         space; but I'd have to double check the details.
>
>
>     That's always true on the PDP-11 and Vax, no matter what the OS,
>     because the processor architecture (which has pre-increment and
>     post-decrement instructions, but not their counterparts) makes
>     anything but a downward-growing stack unmanageable.
>
>
> Ah, but if one has a fixed-size stack that cannot be extended, one can 
> put it anywhere one wants in the virtual address space. E.g., right 
> after the program text segment or whatever (effectively using the text 
> as a guard to detect stack overflow). I don't know why one would want 
> to do that, except that it makes freeing the virtual address space 
> slightly simpler when the process exits, but the point is that the 
> Unix choice isn't the only way. That said, stacks and data growing 
> toward each gives the maximum amount of flexibility.
>
>     In OSes without virtual memory like RSX-11[ABC], RT-11, and
>     mini-Unix/LSX-11, what counts as the top naturally varies.
>
>
On TOPS-10, I got into the habit of putting the PDL at the end of the 
lowseg. If it ran over, it would die.

ak




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200825/bd705390/attachment.htm>


More information about the TUHS mailing list