Article View: borland.public.cppbuilder.nativeapi
Article #1080malloc versus GlobalAlloc
From: Eyyub Volkan �ektimur
Date: Tue, 20 Nov 2007 08:25
Date: Tue, 20 Nov 2007 08:25
16 lines
1732 bytes
1732 bytes
When EXE & DLL have different memory managments, if you malloc memory at DLL and free it at EXE, the heaps get mixed and you get an exception. I can understand that. when i read GlobalAlloc/GlobalFree documentation, it says that those functions are using default heap (means GetProcessHeap()). So, when i create memory with GloballAlloc in DLL and GlobalFree it in EXE, it does not give an exception ? GetProcessHeap() returns the same value in DLL & EXE. is that mean the heaps are same ? if the heaps are same, why malloc/free giving an error ? does not malloc/free using GlobalAlloc or HeapAlloc ? thanks for helping... P.S. : GMEM_FIXED param. used to create memory with GlobalAlloc. -- _______________________ Eyyub Volkan �ektimur Proya Software Inc. Head of Core Development
Technical Details
Message-ID:
<47429a08$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,5bc4a8822b5c2c43,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII From: "Eyyub Volkan �ektimur" <evcektimur@prokon.com.tr> Newsgroups: borland.public.cppbuilder.nativeapi Subject: malloc versus GlobalAlloc Date: Tue, 20 Nov 2007 10:25:46 +0200 Lines: 18 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 88.248.77.154 Message-ID: <47429a08$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1195547144 88.248.77.154 (20 Nov 2007 00:25:44 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail