🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6045

Re: How to Make Sure that Buffer use ONLY memory

#6045
From: JD
Date: Mon, 13 Jun 2005 02:13
32 lines
2034 bytes
"Deniel" <DenielMail@Internet.com> wrote:
>
> [...] if i'll use 'new' the allocation will be ONLY in
> the 'real' memory without that 'paging' thing that use tha
> hard-drive as part of the memory?

Correct. 'new' will throw if it can't allocate from RAM but
there's a twist that I forgot to mention. Available memory
often does not equal the largest memory block available.

To utilize all available memory, you would need multiple
'new's and some method of treating the blocks as if they
were contiguiouse.

> [...] but does it realy works this way?

For Windows, yes. For Linux, if you ask for more than what is
available, as soon as you dereference that pointer, your
application terminates.

>>I would suggest that you just try to allocate 150MB and if and
>>when it fails, step down the size requested and try again until
>>it succeeds.
>
>Yes that's the way.

Maybe not. Alan makes a strong point with 'smart' caching. I
think that you need a more indepth analysis to confirm and
that's a test that you need to devise.

~ JD
Technical Details
Message-ID: <42acebc2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <42ab3793$1@newsgroups.borland.com> <gjmna117s71qnpihpbtg7sqmbbvaob90q6@4ax.com> <42abfa21$1@newsgroups.borland.com> <42ac35d0$1@newsgroups.borland.com> <42ac8a8a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,93efc3d53d15c3e4
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: How to Make Sure that Buffer use ONLY memory 
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 205.188.116.135     
X-Forwarded-For: 172.208.109.74
References: <42ab3793$1@newsgroups.borland.com> <gjmna117s71qnpihpbtg7sqmbbvaob90q6@4ax.com> <42abfa21$1@newsgroups.borland.com> <42ac35d0$1@newsgroups.borland.com> <42ac8a8a$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42acebc2$1@newsgroups.borland.com>
Date: 12 Jun 2005 19:13:22 -0700
X-Trace: newsgroups.borland.com 1118628802 207.105.83.66 (12 Jun 2005 19:13:22 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail