Page 1 of 1

Reference counting and weak pointers

Posted: 06 Feb 2007, 16:44
by jcnossen
Not exactly new stuff, but none of the AIs are using them. Especially in an environment with a lot of dynamically allocated objects, they can be very useful and make things a lot more stable. I'm still wondering why I didn't use it for JCAI...

Anyway I just wanted to point out that I think these things would help all AIs...

If you want an idea of how to implement it take a look at http://www.cbloom.com/3d/techdocs/smart_pointers.txt

Posted: 06 Feb 2007, 18:15
by AF
NTai makes extensive use of boost_shared_ptr, and I have to say its made memory management a lot less painful.