Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.arch Subject: Re: Segmented Architectures ( formerly Re: 48-bit computers) Message-ID: <6862@auspex.auspex.com> Date: 27 Mar 91 23:09:12 GMT References: <1991Mar21.164242.886@sj.nec.com> Organization: Auspex Systems, Santa Clara Lines: 33 >C assumes that pointers are linear and monotonically increasing. Well, many C programs do so. The ANSI C standard makes an effort not to demand that pointers refer to a linear address space with monotonically-increasing addresses; pointers may be compared only for equality, unless both pointers point into the same array, pointer+integer is defined mainly in terms of array indexing, and pointer-pointer is defined only if both pointers point into the same array. It may be that, at least at present, programs of that sort are sufficiently common that you really *do* have to pretend the address space is one single huge array even on machines where that model isn't natural. Maybe that'll change in the future; it'd certainly be nice if it did. >If you are saddled with small segments with N < 2**18 or so, you will soon >come to hate segments because you have to continually map C addresses onto >multiple segments in order to support the linear model. And also have to deal with "near" and "far" pointers, and multiple memory models, in programs that require more than a segment's worth of code or data - at least in C. What do other programming languages that support pointer-style data types do? Do they also have to deal with "near" and "far" pointers? Or, in the memory models with more than a segment's worth of data, do they just make pointers large? >By using the same page table for every process, sharing of the operating >system, code of shared libraries, etc. is enabled. I assume you mean "simplified" rather than "enabled". Sharing of the operating system, code of shared libraries, etc. is certainly possible on systems that have per-process page tables....