Re: metablob fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 17, 2011 at 10:17 PM, Sage Weil <sage@xxxxxxxxxxxx> 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.  :/

I'm afraid not. You can't put something into an STL container unless
it has a working copy constructor.

By using std::insert instead of operator[], you avoid the need for a
default constructor, but you can't avoid the copy.

By the way, tr1::shared_ptr is the shiny new, standardized version of
boost::smart_ptr.

cheers,
Colin
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux