Windows中内存分配方法比较

The following is a brief comparison of the various memory allocation methods: CoTaskMemAlloc GlobalAlloc HeapAlloc LocalAlloc malloc new VirtualAlloc Although the GlobalAlloc, LocalAlloc, and HeapAlloc functions ultimately allocate memory from the same heap, each provides a slightly different set of functionality. For example, HeapAlloc can be instructed to raise an exception if memory could not be allocated, a capability not available… Continue reading Windows中内存分配方法比较