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.129.169 with SMTP id nx9mr3011161pbb.2.1331148777581; Wed, 07 Mar 2012 11:32:57 -0800 (PST) MIME-Version: 1.0 Path: h9ni50752pbe.0!nntp.google.com!news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Arbitrary Sandbox Date: Wed, 7 Mar 2012 19:32:52 +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-07T19:32:52+00:00 List-Id: > But there's an inherent inefficiency in segmentation: the size of > all your pointers doubles. Or to look at it the other way around, > for any given amount of address space, it's split inconveniently. > With the amount of memory I can afford today, a 32-bit segment > number plus a 32-bit offset wouldn't be enough (both too few > segments and segment size too small). 64-bit seg num plus > 64-bit offset? OK, big enough, but inefficient. 64-bit flat > address space: perfect! ;-) How many programs have more than 2**16 different objects? 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. Big addresses take a lot of storage if you have large arrays of full pointers (not just offsets). 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. Segments are like using people's first names, or even pronouns, instead of full names all the time. You can't run a company-wide database on first names, but in most discourse you would say something like "Does Bob want coffee too?", not "Does Robert A Duff want coffee too?".