From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,28b0249f7691568e X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,28b0249f7691568e X-Google-Attributes: gid1164f8,public From: Terje Mathisen Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so) Date: 1999/05/12 Message-ID: <37399C90.7829@hda.hydro.com>#1/1 X-Deja-AN: 477041243 Content-Transfer-Encoding: 7bit References: <371AD875.407C6B83@igs.net> <7g4tng$5ue$1@nnrp1.dejanews.com> <7h7vnn$2ts$15@nntp.Stanford.EDU> <5l4sljqx5d.fsf@tequila.cs.yale.edu> <926495090.942894@haldjas.folklore.ee> <37396C9A.BD7A1D3B@hda.hydro.com> <926518491.202473@haldjas.folklore.ee> Organization: Hydro Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.arch,comp.sys.dec Sander Vesik wrote: > > In comp.arch Terje Mathisen wrote: > > OTOH, it makes it much harder to write error-free high-level code that > > uses these data structures, languages which simply don't allow direct > > access to pointers need not apply at all. > > Why harder? You just have to add one addition in there everywhere. > > Searching in a linked list would be: > > while (k != SHARED_NULL) > { > if (k->data != item) > k=(struct xyz*)((char *)(k->next) + seg_base); I believe most programmers will agree that the line above is a _lot_ more likely to cause bugs than a (type-safe) k = k->next; > If a shared segment was just an object that overrided the [] operator > (which would be written in some other language) and we were content with > having the shared segemnt consist of only an array of object of same type > (and size) we suddenly have based pointers (as indexes of the above > pseudo-array). I considered that option, but it would require that all the possible base addresses must be an integral multiple of the object size, which would pretty much limit this approach to a small set of powers-of-two object sizes. Terje -- - Using self-discipline, see http://www.eiffel.com/discipline "almost all programming can be viewed as an exercise in caching"