🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with memory again

#9211
From: Sara T.
Date: Sun, 25 Jul 2004 09:54
14 lines
1653 bytes
Thanks a lot, I will try again and let you know the result.
Actually all my codes are using "new" and "malloc" to allocate memory,
"delete " and "free" to deallocate memory. For your reccommendation, I
thought number 3 gives me to change a little code. I hope that it will work.

Sara T.

> 3) Use the WinAPI
> long*One = GlobalAlloc( GMEM_FIXED ,sizeof(long) );
> GlobalFree( One );
> But it's better to alloc arrays, and put small variables on the stack.
> I prefer GMEM_FIXED because it returns an address instead of a handle,
> and handles are in short supply, so don't use GMEM_MOVEABLE unless you
> really need it.
Technical Details
Message-ID: <41038349@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4100b152@newsgroups.borland.com> <4100c97e@newsgroups.borland.com> <4101d3e2@newsgroups.borland.com> <e114g01bs4bjh4j1ec2fbtpm4qai4c3bvt@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e9f11b4f112d3007
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Sara T." <sarana@infoquest.co.th>
From: "Sara T." <sarana@infoquest.co.th>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4100b152@newsgroups.borland.com> <4100c97e@newsgroups.borland.com> <4101d3e2@newsgroups.borland.com> <e114g01bs4bjh4j1ec2fbtpm4qai4c3bvt@4ax.com>
Subject: Re: Problem with memory again
Date: Sun, 25 Jul 2004 16:54:13 +0700
Lines: 18
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 203.145.27.28
Message-ID: <41038349@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090749257 203.145.27.28 (25 Jul 2004 02:54:17 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail