Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watmath.UUCP Path: utzoo!watmath!rbutterworth From: rbutterworth@watmath.UUCP (Ray Butterworth) Newsgroups: net.lang.c,net.lang.c++,net.arch Subject: Re: oops, corrupted memory again! Message-ID: <2393@watmath.UUCP> Date: Thu, 1-May-86 11:53:40 EDT Article-I.D.: watmath.2393 Posted: Thu May 1 11:53:40 1986 Date-Received: Fri, 2-May-86 22:28:39 EDT References: <4495@cbrma.UUCP> <763@bentley.UUCP> <117@prairie.UUCP> Organization: U of Waterloo, Ontario Lines: 13 Xref: watmath net.lang.c:8768 net.lang.c++:175 net.arch:3180 > You're probably better off with a language that compiles checks into > the code, and an option to turn off those checks once you're confident > (?!) of the program. With a capability-based architecture, you pay the > price all the time, whether you want to or not. Many years ago I worked with a language in which all arrays had to have dimensions that were a power of two (like 4.2 malloc). The code which indexed into the array simply anded the index with the appropriate bit mask. This was very fast, yet it guaranteed that any bad indexes wouldn't corrupt anything except the array being addressed. As a side-effect, one could use this feature to cycle continuously through an array or could even use negative indexes without any extra overhead.