Re: How to create a 10000000000 size array ?
From: josh (smileyfaceswillruletheworld_at_yahoo.com.NOSPAM)
Date: 09/24/04
- Next message: Scott McPhillips [MVP]: "Re: Error in float conversion"
- Previous message: Sigurd Stenersen: "Re: How can I print the name of an enum member?"
- In reply to: I hate VC very much: "Re: How to create a 10000000000 size array ?"
- Next in thread: Ron Natalie: "Re: How to create a 10000000000 size array ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 17:24:23 -0700
I hate VC very much wrote:
> um.....maybe I should not write 100000000000000....
> actually, what I want it to create is a pointer(LPVOID) array which can store
> 4294967296 elements, ie. it can store totally 32bits elements
>
> I just want a class of array which does not use MFC.
> If anyone knows it, please answer me. Thanks..
If your pointers are the same size as the minimum addressable unit, you
can cover the entire address space, but you won't have room for anything
else. eg, if your pointers are 8-bits wide and your memory is divided
into octets, you have 256 memory locations and room for exactly 256
pointers.
In Win32, pointers are 4 times the size of the minimum addressable unit.
You have 4 billion memory locations, but only room for 1 billion
pointers in your address space. Actually you have a lot less than this,
since the OS and your code take up a lot of space, and presumably you're
not just pointing to other places in your array, so you need room for
those other objects.
You probably want to look at some sort of "sparse" array structure, or
rethink the whole thing from the beginning. Do you really need to cover
the entire addressable space? Do you really need to cover it at a
1-byte resolution? Do you really need to store these pointers at all,
or are they constants that you can think away into conceptual oblivion?
-josh
- Next message: Scott McPhillips [MVP]: "Re: Error in float conversion"
- Previous message: Sigurd Stenersen: "Re: How can I print the name of an enum member?"
- In reply to: I hate VC very much: "Re: How to create a 10000000000 size array ?"
- Next in thread: Ron Natalie: "Re: How to create a 10000000000 size array ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|