Tracking memory allocation

Robert Shearman rob at codeweavers.com
Wed Oct 25 05:20:28 CDT 2006


Jeff L wrote:
> I am looking at how to track whether memory has been allocated or 
> freed.  The SCRIPT_STRING_ANALYSIS opaque point in usp10 can be freed 
> in a number of places.  It seems that Windows handles this by checking 
> a list of allocated storage as the passed value of a 
> SCRIPT_STRING_ANALYSIS could be invalid.  An obvious problem is where 
> SCRIPT_STRING_ANALYSIS pointer is passed or copied to another 
> pointer.  At best one pointer could be NULLed but not both.  I have 
> seen this behaviour.  It seems that this would not be a unique problem 
> in wine, is there a standard way to handle memory tracking so that if 
> memory is freed, at a later time we can check to see if the pointer is 
> still valid?

It sounds like you could benefit from using the handle table functions 
in ntdll.

-- 
Rob Shearman




More information about the wine-devel mailing list