The wpAllocMem method allocates memory for use by an object. A record of memory blocks allocated by calls to wpAllocMem is kept by adding USAGE_MEMORY type items to the object's USEITEM list. The USEITEM list is examined by wpUnInitData when the object is destroyed or made dormant to free previously allocated resources.
Memory that is allocated to an object is de-allocated automatically when the object is no longer in use, assuming the memory has not already been cleaned up by the object. wpFreeMem is called to free allocated memory, even if the object is still in use. This method should be overriden to free memory that was allocated with an override method of wpAllocMem.