comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Large arrays (again), problem case for GNAT
Date: Fri, 15 Apr 2005 00:21:50 -0500
Date: 2005-04-15T00:21:50-05:00	[thread overview]
Message-ID: <jOOdncUTB_F_08LfRVn-oA@megapath.net> (raw)
In-Reply-To: wccbr8h4c0f.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wccbr8h4c0f.fsf@shell01.TheWorld.com...
> Robert A Duff <bobduff@shell01.TheWorld.com> 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.






  reply	other threads:[~2005-04-15  5:21 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 12:46 Large arrays (again), problem case for GNAT Dr. Adrian Wrigley
2005-04-13 13:10 ` Larry Kilgallen
2005-04-13 13:24   ` Alex R. Mosteo
2005-04-13 13:31   ` Marc A. Criley
2005-04-13 19:52 ` Jeffrey Carter
2005-04-13 19:54 ` Randy Brukardt
2005-04-13 22:01   ` (see below)
2005-04-14  0:16     ` Robert A Duff
2005-04-14  1:11       ` Alexander E. Kopilovich
2005-04-14  7:29         ` Dmitry A. Kazakov
2005-04-14  7:45           ` Duncan Sands
     [not found]           ` <1113464720.9829.20.camel@localhost.localdomain>
2005-04-14 13:59             ` Marius Amado Alves
2005-04-14 14:09               ` Dr. Adrian Wrigley
2005-04-14 14:40                 ` (see below)
     [not found]             ` <389d1596e98f95f0fdddc40afc0647b7@netcabo.pt>
2005-04-14 14:14               ` Duncan Sands
2005-04-14 15:18         ` Robert A Duff
2005-04-14 15:24           ` Robert A Duff
2005-04-15  5:21             ` Randy Brukardt [this message]
2005-04-15 11:49               ` Dr. Adrian Wrigley
2005-04-15 13:21                 ` Dmitry A. Kazakov
2005-04-15 14:31                   ` Dr. Adrian Wrigley
2005-04-15 14:57                     ` Dmitry A. Kazakov
2005-04-14 15:39           ` Dr. Adrian Wrigley
2005-04-14 15:48           ` Dmitry A. Kazakov
2005-04-14 21:19             ` Robert A Duff
2005-04-15  8:23               ` Dmitry A. Kazakov
2005-04-15  8:38                 ` Duncan Sands
2005-04-15  9:16                   ` Dmitry A. Kazakov
2005-04-15 18:30               ` Mark Lorenzen
2005-04-15 19:06                 ` Robert A Duff
     [not found]       ` <iSSDSN2L04G1@VB1162.spb.edu>
2005-04-14  7:34         ` Duncan Sands
2005-04-13 22:35 ` Robert A Duff
2005-04-14 11:40   ` Dr. Adrian Wrigley
2005-04-14 10:44 ` Dr. Adrian Wrigley
2005-04-14 15:03   ` Robert A Duff
2005-04-14 16:46     ` Dmitry A. Kazakov
2005-04-14 18:30       ` Pascal Obry
2005-04-14 19:45         ` Dmitry A. Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2005-04-13 13:52 Duncan Sands
2005-04-13 14:20 ` Dr. Adrian Wrigley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox