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,be7fa91648ac3f12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 15 Apr 2005 00:19:30 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: Large arrays (again), problem case for GNAT Date: Fri, 15 Apr 2005 00:21:50 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-nPmVDVuc/hnEilApF1TG6/JXbg4QTovvB4Lv/0CjX+kQqklbqn/dbAb3f8yUhLsKs/AElnnlKctt4OE!xn2Y0tOBvzkY3b008TMJhV0K15zVAnKvRduBmSE1Jr4KNXT7D549xalCYWC0onO3Kk+WCC64nMPM X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:10482 Date: 2005-04-15T00:21:50-05:00 List-Id: "Robert A Duff" wrote in message news:wccbr8h4c0f.fsf@shell01.TheWorld.com... > Robert A Duff writes: > > > Does anybody here know how to get allocate-on-write under MS Windows? > > Just to be clear: Windows does not allocate physical memory on > allocation, but it does allocate backing store in the page file. > And the page file is limited to 4GB, which isn't all that big > these days. Does anybody know how to tell Windows not to > allocate backing store? > > I want to write a Storage_Pool, which allocates an array of (say) > hundreds of megabytes, and allocate little pieces out of that giant > array. I want to be *able* to use all those hundreds of megabytes, but > I don't want to allocate space in the paging file unless they're > needed. This works by default on most Unices, but not on Windows. You can do something like that with the actual memory management functions of Windows, which separately allocate and commit pages. (Commit uses the backing store.) But you get a trap if the pages aren't commited and are touched. I have a storage pool that sort of works this way. It was intended to allow allocating virtual space for large arrays, and then expand them as needed with committed memory. Warning: although Windows uses 4K pages, address space management allocation is done in 64K chunks. Ask for 1 byte, and you get one byte, and the other 63.9K is lost to all other use. My pool expands the arrays by rewriting the dope of the arrays passed into the functions - something that no one should ever do unless they're the author of the compiler. And probably not even then. I'll e-mail to it you. Randy.