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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be7fa91648ac3f12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!newsfeed.freenet.de!151.189.20.20.MISMATCH!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Large arrays (again), problem case for GNAT Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Thu, 14 Apr 2005 17:48:27 +0200 Message-ID: NNTP-Posting-Date: 14 Apr 2005 17:48:27 MEST NNTP-Posting-Host: 8e2159e3.newsread4.arcor-online.net X-Trace: DXC=RFd5V03?;NomBTbc_2cXMb:ejgIfPPlddjW\KbG]kaMhZmYl>WOG@=e1ajCZd1=aLmWRXZ37ga[7jn919Q4_`VjiB8=X\UUgbkd X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:10467 Date: 2005-04-14T17:48:27+02:00 List-Id: On 14 Apr 2005 11:18:22 -0400, Robert A Duff wrote: > The reason I like allocate-on-write is that it is very useful to > allocate a huge array, and then only use some part of it. That way, the > program can deal with enormous input data, without paying the cost when > the input data is small. Physical memory is 1000 times more expensive > than address space. I think this approach is flawed. The contract of malloc is to return memory not the address space. That must be just another system call. Consider an application that needs contiguous address space. User storage pool is an excellent example. The application must request the space from OS telling something like: "reserve me 100GB and allocate n bytes starting from the first address." After that it could allocate memory *within* that space by pieces as needed. For this it would simply use realloc instead of malloc. No need to break contracts. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de