HeapAlloc is the basic Win32 API for heap allocation. It can allocate from any Win32 heap.GlobalAlloc is from the old Win16 API for heap allocation. It allocates from the default process heap. So the function is there to be compatible with older Windows source code. GlobalAlloc is implemented using HeapAlloc.There could be some differences. For example, you can have a thread with its private heap. Because it's private, you do not need to worry about being multi-thread safe. Then you can use HeapAlloc/HeapFree within the thread using the private heap.GlobalAlloc has to be multi-thread safe. So in this case, HeapAlloc/HeapFree on private heap can be faster than calling GlobalAlloc/GlobalFree.www.fengyuan.com
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货