On Fri, 17 Jun 2011, Sage Weil wrote:
> Hi Sam-
> 
> I pushed a fix for the valgrind error you were seeing to mds_metablob_fix.  
> There was a class used in an STL container that wasn't copyable.  As far 
> as I can tell, you can't actually put items in a container (map<> in this 
> case) that aren't copyable, so I used a boost::smart_ptr.  
> 
> Maybe someone with better C++-fu than I has a way to avoid the copies 
> entirely?  Adding
> 
>       fullbit(const fullbit& other);
>       const fullbit operator=(const fullbit& other);
> 
> fails to link, and if I assert in there I can't get past inserting the 
> initial element.  :/

This didn't work, btw; you can't reclaim the raw pointer from the 
shared_ptr.  That means either using shared_ptr throughout CInode (which 
does some weird stuff with it). 

Instead, I made fullbit non-copyable, and changed dirlump to use

        list<boost::shared_ptr<fullbit> >   dfull;

so that it's never copied.  In general, this is probably a better solution 
for any encoded/decoded type that is largish since it'll avoid copying the 
memory around...

sage



> 
> sage
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to