Article View: borland.public.cppbuilder.nativeapi
Article #5928Re: Full Access to 2 GB memory RAM ?
From: Thomas Maeder [TeamB]
Date: Sun, 26 Jun 2005 14:56
Date: Sun, 26 Jun 2005 14:56
23 lines
1933 bytes
1933 bytes
"Deniel" <DenielMail@Internet.com> writes: > Using Builder 4.0 C++ on XP computer, if my PC have 2 GB of RAM > memory, can i write in my program - > > int *MyBuffer = new int[0.85 * ( 2 ^ 31 )]; Yes. But it will not do why you expect it to do. The operator ^ means 'exclusive or' in C and C++. Since the sets of bits set in the representations of 2 and 31 are disjoint, the expression 2^31 will thus evaluate to 33. The new expression will therefore allocate an array of 28 ints. > and expect that this buffer will sit whole on the RAM (without > paging to the Hard-Disk) and that i'll have full access to all > it's cells from MyBuffer[0] till MyBuffer[1825361100] ? There is no portable way to achieve what you are looking for, and I also wouldn't expect there to be a way at all on most common platforms.
Technical Details
Message-ID:
<m264w1goa3.fsf@madbox2.local>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42be94fa$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,256f8494310fe6f6
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Full Access to 2 GB memory RAM ?
References: <42be94fa$1@newsgroups.borland.com>
From: maeder@glue.ch (Thomas Maeder [TeamB])
Organization: TeamB
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Date: Sun, 26 Jun 2005 16:56:20 +0200
Message-ID: <m264w1goa3.fsf@madbox2.local>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)
Cancel-Lock: sha1:2rFzjpGreUtQeR1YQq3mv8byeaI=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
NNTP-Posting-Host: 84.73.0.67
X-Trace: newsgroups.borland.com 1119797793 84.73.0.67 (26 Jun 2005 07:56:33 -0700)
Lines: 23
X-Authenticated-User: tmaeder
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail