Article View: borland.public.cppbuilder.nativeapi
Article #6975Re: Memory problems: new versus GlobalAlloc
From: Wim Bekker
Date: Wed, 30 Mar 2005 11:42
Date: Wed, 30 Mar 2005 11:42
14 lines
1564 bytes
1564 bytes
Reading through more documentation and newsgroups, I've noticed that Borlands new uses VirtualAlloc. Some calls to new, especially when asking a lot of memory use more than one call to VirtualAlloc to get one block. Maybe the block is devided on several pages that are swapped to and from disk. GetDIB, StretchDIBits etc cannot handle this. They need a block that is continous, for example one from GlobalAlloc. This explains why GlobalAlloc works when allocating a buffer and new doesn't work. Wim
Technical Details
Message-ID:
<424a9004@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<42403f3c@newsgroups.borland.com> <42408062$3@newsgroups.borland.com> <42413c01$1@newsgroups.borland.com> <ca9441lbia8eochgsn5f6bltpsjamjf983@4ax.com> <4242b970@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6b3a605b9bc38024 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Wim Bekker" <no-no-no-mail@no-no-noware.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42403f3c@newsgroups.borland.com> <42408062$3@newsgroups.borland.com> <42413c01$1@newsgroups.borland.com> <ca9441lbia8eochgsn5f6bltpsjamjf983@4ax.com> <4242b970@newsgroups.borland.com> Subject: Re: Memory problems: new versus GlobalAlloc Date: Wed, 30 Mar 2005 13:42:50 +0200 Lines: 16 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 82.161.70.62 Message-ID: <424a9004@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112182788 82.161.70.62 (30 Mar 2005 03:39:48 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail