Speicher - Handling
-
Die WINAPI bietet jede Menge verschiedener Funktionen um Speicher zu reservieren, sperren, füllen, leeren, freigeben etc...
Ich würde mich freuen wenn mir jemand die wesentlichen Unterschiede zwischen
* GlobalAlloc()
* LocalAlloc()
* HeapAlloc()
* VirtuallAlloc()erklären könnte. Ich habe bereits die Texte zu allen Funtionen in der SDK gelesen und soweit ich verstanden habe gibt es für die 'normale' Programmierung unter Windows keine bedeutenden Unterschiede zwischen LocalAlloc & GlobalAlloc. HeapAlloc erklärt sich selbst. Was ist mit VirtualAlloc. Wird bei VirtualAlloc der Speicher im Stack reserviert?? Wieso ist hier von virtuell die Rede??
In der SDK steht etwas von sog. Pages. Was sind Pages??Ich bedanke mich im Voraus für euer Interesse.
-
Lies dir aber mal die Sektion About Memory Management - dort sollten deine Fragen eigentlich beantwortet werden. z.B.:
The global and local functions supported for porting from 16-bit code, or maintaining source code compatibility with 16-bit Windows. The global and local 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 and the clipboard functions.
[...]
Windows memory management does not provide a separate local heap and global heap, as 16-bit Windows does. As a result, there is no difference between the memory objects allocated by the GlobalAlloc and LocalAlloc functions.