Xref: utzoo comp.arch:6588 comp.lang.c:13276 Path: utzoo!attcan!uunet!ateng!chip From: chip@ateng.ateng.com (Chip Salzenberg) Newsgroups: comp.arch,comp.lang.c Subject: Re: Contiguous address spaces Keywords: virtual machine language design Message-ID: <1988Oct13.210524.22909@ateng.ateng.com> Date: 14 Oct 88 01:05:24 GMT References: <853@goofy.megatest.UUCP> <815@super.ORG> <1750@ficc.uu.net> Followup-To: comp.lang.c Organization: A T Engineering, Tampa, FL Lines: 28 Let's get this segment thing straight. According to peter@ficc.uu.net (Peter da Silva): >This is a UNIX assumption, not a 'C' one. 'C' works just fine with non- >contiguous segments *if* the segments can be made large enough for any >given memory object. 'C' has definite problems with memory objects bigger >than a segment. True. Microsoft's solution ("huge") is kludgy, but better than nothing. >UNIX, however, likes each address space to be contiguous. Look at the >behaviour of sbrk(), for example. Sbrk() works just fine on the very segmented '286, thank you very much. Some *programmers* assume that: char *p = sbrk(512) + 512; char *q = sbrk(512); implies "p == q". It doesn't, and it never did. (Read the man page again.) >(actually, what /bin/sh does can't be explained in polite company). Can you say "catch SIGSEGV, call sbrk() and retry"? I knew you could. -- Chip Salzenberg or A T Engineering Me? Speak for my company? Surely you jest! Beware of programmers carrying screwdrivers.