From: Michal Jarzabek Date: Wed, 4 May 2016 21:39:26 +0000 (+0100) Subject: osd/OSD.h: move shared_ptr instead of copying it X-Git-Tag: v11.0.0~624^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efe13961ffe4440d7416ed2775bd6db02ad9d79f;p=ceph.git osd/OSD.h: move shared_ptr instead of copying it By copying map to next_osdmap we are increasing the shared_ptr's reference count, which is then decreased again when map variable goes out of scope. This can be avoided by using std move. Signed-off-by: Michal Jarzabek --- diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 1ec1bd487bc8..46dd384514e4 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -505,7 +505,7 @@ public: Cond pre_publish_cond; void pre_publish_map(OSDMapRef map) { Mutex::Locker l(pre_publish_lock); - next_osdmap = map; + next_osdmap = std::move(map); } void activate_map();