From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,af0c6ea85f3ed92d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.220.229 with SMTP id pz5mr3768037pbc.5.1331171460361; Wed, 07 Mar 2012 17:51:00 -0800 (PST) MIME-Version: 1.0 Path: h9ni96pbe.0!nntp.google.com!news1.google.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Arbitrary Sandbox Date: Thu, 8 Mar 2012 01:50:58 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Lf0Nl3CcQzx+ocHx9cmuGg.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Tom's custom newsreader Date: 2012-03-08T01:50:58+00:00 List-Id: > An array of a million Booleans contains a million objects, in > the Ada sense. In a segment based architecture that would be one segment. The array is the object at that level, not the bit. If you pass that array as a procedure argument, you mention one name, not a million. > >...But segments shrink *code* size by > > occasionally loading segment registers, but usually using a small number > > of bits to indicate which segment register to use in an operation. > > If I understand what you mean, it seems to me you can use a small > number of bits to indicate which register points to the beginning > of an array in a flat address space, just as well. Yes, you can partially simulate segmented addresses that way. But using general registers, rather than specific registers, means the hardware can't help. If they are hardware segment registers they can have security/usage/paging bits and the OS can tell which segments are in use when it wants to swap something, for instance. If you want to code at the bit level in asm or C, then certainly having every bit equal, with the individual programmer deciding what every bit means, is appropriate. If you want to code at a higher level, with things like "this is an array segment, it's currently located in RAM starting here, its size is xxx, it's read-only, non-executable", then I prefer segments.