Article View: borland.public.cppbuilder.nativeapi
Article #5830Re: Full Access to 2 GB memory RAM ?
From: Deniel
Date: Sun, 26 Jun 2005 15:08
Date: Sun, 26 Jun 2005 15:08
40 lines
1808 bytes
1808 bytes
>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. Sorry, i ment of cource to the folowing - int MySize, *MyBuffer; MySize = 0.85 * pow( 2, 31 ); // 2^31 = 2GB MyBuffer = new int[MySize ]; >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. I don't understand, where exactly is the problem? If i whould wrtie this - MyBuffer = new int[200]; there whould be no problem right? but if i write this - MyBuffer = new int[0.85 * 0x80000000]; // 85% of 2GB Then THERE WILL be a problem.... right? So where does the problem starts? what is the limit size that start making problems? Please describe, Thanks. Dani.
Technical Details
Message-ID:
<42bec50a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42be94fa$1@newsgroups.borland.com> <m264w1goa3.fsf@madbox2.local>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,256f8494310fe6f6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Deniel" <DenielMail@Internet.com> Sender: "Deniel" <DenielMail@Internet.com> Reply-To: "Deniel" <DenielMail@Internet.com> Subject: Re: Full Access to 2 GB memory RAM ? Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 62.0.27.159 References: <42be94fa$1@newsgroups.borland.com> <m264w1goa3.fsf@madbox2.local> NNTP-Posting-Host: 207.105.83.66 Message-ID: <42bec50a$1@newsgroups.borland.com> Date: 26 Jun 2005 08:08:58 -0700 X-Trace: newsgroups.borland.com 1119798538 207.105.83.66 (26 Jun 2005 08:08:58 -0700) Lines: 41 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail