From 1dee6e02294fe547717190eb5bcb86bde149aad4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 7 Jan 2003 23:12:02 +0000 Subject: [PATCH] Small optimization. [SVN r16790] --- sp_debug_hooks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sp_debug_hooks.cpp b/sp_debug_hooks.cpp index 26d9c51..3d5fb15 100644 --- a/sp_debug_hooks.cpp +++ b/sp_debug_hooks.cpp @@ -159,7 +159,7 @@ static void scan_and_count(void const * area, size_t size, map_type const & m, s { shared_ptr_layout const * q = reinterpret_cast(p); - if(q->pn.id == boost::detail::shared_count_id && m.count(q->pn.pi) != 0) + if(q->pn.id == boost::detail::shared_count_id && q->pn.pi != 0 && m.count(q->pn.pi) != 0) { ++m2[q->pn.pi]; } @@ -175,7 +175,7 @@ static bool scan_and_mark(void const * area, size_t size, map_type const & m, st { shared_ptr_layout const * q = reinterpret_cast(p); - if(q->pn.id == boost::detail::shared_count_id && m.count(q->pn.pi) != 0) + if(q->pn.id == boost::detail::shared_count_id && q->pn.pi != 0 && m.count(q->pn.pi) != 0) { // mark as reachable