use count instead of count1/2.
Allocate global memory in advance. Mainly change WinAllocator.h file.