Newsgroups: comp.os.minix
Subject: Re: question about minix-vmd
References: <o3h1i9.svf.ln@nnews.ath.cx> <slrn9k8k9s.2nb.pino+comp_os_minix@mud.stack.nl> <ieh3i9.7ag.ln@nnews.ath.cx>
Organization: Minix
Message-ID: <1ilvts7tj3977v6acj8071e1r1@stereo.pch.home.cs.vu.nl>
From: philip@pch.home.cs.vu.nl (Philip Homburg)
Date: Sat, 7 Jul 2001 09:11:59 +0200
Lines: 26
NNTP-Posting-Host: 213.84.34.176
X-Trace: 994489922 newszilla.xs4all.nl 14020 213.84.34.176
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!transit.news.xs4all.nl!newszilla.xs4all.nl!not-for-mail
Xref: news.adfa.edu.au comp.os.minix:37805

In article <ieh3i9.7ag.ln@nnews.ath.cx>, Paul <paul@mmail.ath.cx> wrote:
>As things stand now in Minix,
>in thoery, compiler should be able to generate codes that checks whether the
>top of heap and bottom of stack is going to overlap every time something is
>going to use more stack, and also malloc can be implemented without
>bothering the OS.....all because the two areas are given a static
>pre-determined address space and should be able to manage it by itself......
>Of course, that is not to say OS shouldn't enforce checks.....

Thit is the world of C: very dangerous. I guess that in the early days,
the runtime costs were simply to high. Nowadays, the virtual memory system
can make those checks. 

>I'm just wondering, (and guessing ) why traditionally malloc is implemented
>with brk() that bothers the OS every time, a program should in theory know
>its own stack and heap pointers. 

Because you have to ask the OS for more memory. PDP11s running early versions
Unix already had the VM hardware to enforce this. Brk is there to ask the OS
for more memory. Otherwise, you can simply start with a large BSS segment and
use that.




						Philip Homburg
