Page 1 of 1

Shared pointers, memory management & allocators

PostPosted: Wed Sep 09, 2009 12:43 pm
by fips
I've been recently thinking about the right memory model for my latest game-related codebase and I've found this issue crucial when it comes to code reusability.

I'm not quite convinced that the obvious choice - Shared Pointers is the right way to go. The idea that the object ownership is spread across the system without explicit control isn't appealing to me anymore. Moreover, it seems to me now that really complex reusable data structures have to be free of the ownership management.

This thoughts bring me back to good old Raw Pointers!, however, combined with a custom allocator. The allocator would manage an underlying system of packages. So every new allocated object would be associated with a package, which would define object's lifetime.

FipS

Re: Shared pointers, memory management & allocators

PostPosted: Fri Jul 09, 2010 8:10 am
by fips