flat assembler
Message board for the users of flat assembler.

Index > Windows > heap vs. global memory

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
what's difference between global (GlobalAlloc) and heap (HeapAlloc) memory? does the global memory get bigger performace hit on allocation / resizing or what?
Post 26 Oct 2005, 10:53
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tango



Joined: 05 Apr 2004
Posts: 5
Location: Italy
tango
vid wrote:
what's difference between global (GlobalAlloc) and heap (HeapAlloc) memory? does the global memory get bigger performace hit on allocation / resizing or what?


Maybe this can help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/memory_management.asp

Microsoft says that HeapAlloc is faster than GlobalAlloc (and has more options)...
I've not tested that (about the speed).
Post 26 Oct 2005, 11:32
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
From what I read it seems that heap functions should be used to allocate smaller blocks of memory, while GlobalAlloc - for bigger ones.
Perhaps f0dder could tell much more about this topic...
Post 26 Oct 2005, 12:31
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 975
Location: Czechoslovakia
MazeGen
I have just found accidentally f0dder's article about it. Maybe it helps.

Go to http://f0dder.has.it/ -> Articles -> Memory allocation ramblings
Post 26 Oct 2005, 14:18
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
thx...

it was about fasmlib. does it need to call GlobalAlloc, or can be all allocation done via HeapAlloc. Does anybody know how do the HLLs treat this? A i know, in DOS and Linux everything is heap.
Post 26 Oct 2005, 21:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Eoin



Joined: 16 Jun 2003
Posts: 68
Location: Ireland
Eoin
According to f0dder, Gobal/LocalAlloc both end up using HeapAlloc so you may as well just use it in the first place Smile .

P.S. I think Gobal/LocalAlloc are left over from 16bit Windows, pre 9x.
Post 26 Oct 2005, 22:11
View user's profile Send private message Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 140
Location: Severodvinsk, Russia
SFeLi
Post 27 Oct 2005, 02:41
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.