foreach counter now must be size_t ?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Feb 6 21:23:20 UTC 2019


On Wed, Feb 06, 2019 at 08:59:14PM +0000, Rubn via Digitalmars-d wrote:
> On Wednesday, 6 February 2019 at 06:27:27 UTC, Patrick Schluter wrote:
[...]
> > Memory mapping archives and video files can easily get beyond 32
> > bits.  It's not because you never noticed that there aren't people
> > out there doing that every day.
[...]
> I never knew arrays were files, thanks for the tip.

As you may know, mmap() turns files into arrays (see std.mmfile).  You
access it just like an array, and the OS maps it to the file for you.

You wouldn't want somebody to pass the array returned by an mmap() call
to your code that assumes arrays cannot have length larger than 32-bits
-- you'd run into wraparound bugs.

Just because the array has a huge size doesn't necessarily mean you need
that much RAM to hold it. The OS pages parts of it in/out as you access
it.


T

-- 
If blunt statements had a point, they wouldn't be blunt...


More information about the Digitalmars-d mailing list