← Back to team overview

yade-dev team mailing list archive

Re: shared_ptr<PhysicalAction>

 

Václav Šmilauer said:     (by the date of Tue, 17 Feb 2009 08:38:07 +0100)

> Hi there, any reason PhysicalActionContainer contains shared_ptr's?
> Wouldn't it be better to contain just array of PhysicalActions? It would
> allow for very fast resetting with
> memset(action[0],0,sizeof(thisAction)) and perhaps would save some
> shared_ptr overhead we have currently. V.

the only reason was "we use shared_ptr everywhere, because we're too
stupid to manage memory leaks".

afaik, shared_ptr provides some lock free mechanisms, but I didn't check.

feel free to experiment.

-- 
Janek Kozicki                                                         |



Follow ups

References