Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!amdahl!amdcad!phil From: phil@amdcad.UUCP (Phil Ngai) Newsgroups: comp.sys.intel,comp.lang.c Subject: segments and Unix Message-ID: <13802@amdcad.UUCP> Date: Tue, 18-Nov-86 14:44:48 EST Article-I.D.: amdcad.13802 Posted: Tue Nov 18 14:44:48 1986 Date-Received: Tue, 18-Nov-86 21:44:01 EST Organization: AMDCAD, Sunnyvale, CA Lines: 22 Xref: mnetor comp.sys.intel:21 comp.lang.c:87 I'd like to propose something here. Have you ever spent a few days tracking down a bug caused by writing beyond the bounds of an array and trashing a vital data structure which only gets noticed many cycles later? Strings, of course, are arrays. Suppose every data structure were in its own segment. And of course, that every segment were big enough to hold any data structure you needed so that you didn't need to manage multiple segments for one data structure. Then when a bug trys to access beyond the end of an array, the bad reference is trapped at the time of dereference instead of invisibly (at the time) trashing an innocent data structure that happened to be in the right (wrong) place. Would this be worth doing? Of course, it would complicate the OS's memory management duties. But think about it. -- The distance from the North end of Vietnam to the South end is about the same as the distance from New York to Florida. Phil Ngai +1 408 749 5720 UUCP: {ucbvax,decwrl,hplabs,allegra}!amdcad!phil ARPA: amdcad!phil@decwrl.dec.com