RE: Smart pointers was RE: [GD-General] Compile times
Brought to you by:
vexxed72
From: Wayne C. <wc...@re...> - 2002-12-17 09:46:03
|
> Non-deterministic was a poor choice of phrase. More > like "unpredictable" because, by definition, if you're using smart > pointers you've opted to stop thinking about de-allocation of memory. > So you're never quite sure when the "last reference" is released, since > that can change as the code evolves. I know this a GD list rather than an 'any app list' but do you have a problem with smart pointer\ref counting per se. or just when it relates to game development? :) > > Doing all the memory management manually with naked calls > > to new and delete is feasible with discipline and some programming > > conventions, but there are usually a few instances where this becomes > > difficult. > > Where is it difficult to rely on convention and discipline? COM or a similar object model provides one source where the creator may not necessarily be the one who destroys a particular object. The object may be passed into a completely different part of the system which wants it to stick around. A game environment is quite a controlled environment, but I've heard of a few game engines that use COM (or similar) for their object model. Wayne -Virus scanned and cleared ok |