Re: SysFreeString - Is the memory mine to use as I please ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



<news@xxxxxxxxxxxxxxx> schreef in berichtnieuws
1166780706.515770.17090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hello Richard,

R.Wieser wrote:
Ahhh ... That means I will have to study those Heap* functions a bit
more.

I don't think you need to get too hung up over using GlobalAlloc and
GlobalFree. The docs say "The global functions are slower than other
memory management functions and do not provide as many features.
Therefore, new applications should use the heap functions. However, the
global functions are still used with DDE, the clipboard functions, and
OLE data objects".

Thank you for your vision on it. I pretty-much decided the same for
myself, although I did wonder about wen those global (or local) memory
functions would really be deprecated.

Although ... It makes me remember the old DOS file-functions (using FCB's) :
they where marked "obsolete" as far back as v3.3, but you can still find
them back in many a Windows version :-)

One question I do have : I took a look at those Heap allocation functions,
and could not help but notice that I allways had to make two calls : one to
get a heap-pointer, and one to actually allocate the memory. What I'm
wondering is if it is possible to tell that last function somehow to use the
default heap (by, for instance, setting the heap-pointer argument to Zero) ?

Regards,
Rudy Wieser



.



Relevant Pages

  • Re: GlobalAlloc and HeapAlloc
    ... GlobalAlloc and LocalAlloc need to support legacy concepts like handles to movable memory blocks and things like that. ... There is essentially another layer of translation and indirection before you get down to the process heap that is used to implement those functions. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Static memory allocation
    ... >> section versus Windows GlobalAlloc. ... >> understanding of protected mode memory management ... >When a process is created, at least on NT systems, a file mapping object is ... >BSS cannot load, then surely it GlobalAlloc will simply result in a runtime ...
    (comp.lang.asm.x86)
  • Re: HANDLE vs. POINTER
    ... As I understand it GlobalHandle gets the Handle of a block of memory ... with API level memory allocation ... Memory objects allocated by GlobalAlloc and LocalAlloc are in private, ... Applications requiring shared memory for other purposes must use ...
    (microsoft.public.vb.winapi)
  • Re: HLA v1.98 is now available on Webster
    ... Why are you making 'GlobalAlloc' calls? ... The cost is that it appear to use more memory then it needs. ... mov((type byte ), cl); ... just create a heap and allocate ...
    (alt.lang.asm)
  • Re: virtual memory question
    ... User Accessible Memory obtained with VirtualAlloc and/ot GlobalAlloc ... > The API hooks were the problem and not the WH_ message hooks. ...
    (microsoft.public.win32.programmer.kernel)