From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] plan 9 overcommits memory? From: Charles Forsyth Date: Tue, 4 Sep 2007 01:04:33 +0100 In-Reply-To: <86225ce4da8f29d4a4e8301563bec686@quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: b733065c-ead2-11e9-9d60-3106f5b1d025 > perhaps i've been unclear. i don't have any problem dealing with failed > alloc. malloc has always been able to return 0. > > dealing with a page fault due to overcommit is a different story. that's a slightly different aspect. the note should not be "page fault" but "out of memory" (or some such thing). that's much better than a nil return. most errors on shared resoruces are better expressed as exceptions (notes), because that's what they are: they are a failure of the underlying physical or virtual machine to handle an exceptional case. the code shouldn't have to deal with it explicitly everywhere, except in C to detect and propagate the exception to code that knows what's going on. exceptions have acquired a bad name in some circles because of the way that some people tried to use them for situations, usually in interfaces, that are hardly exceptional (eg, Ada and Java).