Using VC++6.0 to achieve memory allocation and release based on partner algorithm