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.74.201 with SMTP id w9mr3698222pbv.0.1331167804846; Wed, 07 Mar 2012 16:50:04 -0800 (PST) Path: h9ni51607pbe.0!nntp.google.com!news1.google.com!news.glorb.com!solaris.cc.vt.edu!news.vt.edu!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Arbitrary Sandbox Date: Wed, 07 Mar 2012 19:50:03 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1331167804 26147 192.74.137.71 (8 Mar 2012 00:50:04 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 8 Mar 2012 00:50:04 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2D8PpQrKiHPLylkl4BzGRDZ1+fg= Content-Type: text/plain; charset=us-ascii Date: 2012-03-07T19:50:03-05:00 List-Id: tmoran@acm.org writes: > How many programs have more than 2**16 different objects? Do you mean "object" as defined in Ada? If so, lots of programs have far more. If not, then you'll have to explain how you want to map Ada objects into segments, and what you expect to accomplish thereby. I've seen lots of ideas in that area, and none of them make a whole lot of sense to me. An array of a million Booleans contains a million objects, in the Ada sense. >...You could use > 16 bit segment numbers and 48 bit offsets to give you 64 bit pointers. > That's 64K distinct segments, each of 256 terabytes. A flat 64 bit > address is going to have the upper quarter (at least) of bits zero anyway > on most machines for some years to come. I agree that a 48-bit offset is big enough. I don't agree that a 16-bit segment number is big enough. OK, so maybe split 24/40 instead of 16/48? Still not enough segments. That's the problem -- however you split those 64 bits, you have not enough segments or not big enough segments, or both. A flat address space solves the problem -- the programmer gets to decide whether to have a huge number of small objects, or a small number of huge objects, or something in between. > Big addresses take a lot of storage if you have large arrays of full > pointers (not just offsets). Agreed. So use array indices instead, when that's the problem. >...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. - Bob