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 26 Oct 2005, 10:53
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 26 Oct 2005, 11:32
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 26 Oct 2005, 12:31
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: 977
Location: Czechoslovakia
MazeGen 26 Oct 2005, 14:18
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 26 Oct 2005, 21:38
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 26 Oct 2005, 22:11
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: 138
SFeLi 27 Oct 2005, 02:41
Post 27 Oct 2005, 02:41
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.