Given a pointer to some variable.. is there a way to check whether it was statically or dynamically allocated??
The ACE library does this all over the place. You may be able to check how they do it. In general you probably shouldn't need to do this in the first place though...