]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore/btree: only compile debug-purposed methods in debug
authorXuehan Xu <xuxuehan@qianxin.com>
Sun, 29 Jun 2025 09:38:37 +0000 (17:38 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Wed, 2 Jul 2025 10:11:30 +0000 (18:11 +0800)
builds

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/btree/fixed_kv_btree.h

index 513fbbd2e65500d1b2b101c0b53ac6932123ceb5..d60db362bbdce78389fee27adbe19abc9c75789f 100644 (file)
@@ -101,7 +101,9 @@ public:
       op_context_t c,
       mapped_space_visitor_t *visitor=nullptr) const
     {
+#ifndef NDEBUG
       assert_valid();
+#endif
       assert(!is_end());
 
       auto ret = *this;
@@ -126,7 +128,9 @@ public:
 
     iterator_fut prev(op_context_t c) const
     {
+#ifndef NDEBUG
       assert_valid();
+#endif
       assert(!is_begin());
 
       auto ret = *this;
@@ -167,6 +171,7 @@ public:
       });
     }
 
+#ifndef NDEBUG
     void assert_valid() const {
       assert(leaf.node);
       assert(leaf.pos <= leaf.node->get_size());
@@ -183,6 +188,7 @@ public:
         }
       }
     }
+#endif
 
     depth_t get_depth() const {
       return internal.size() + 1;
@@ -555,9 +561,11 @@ public:
         "ret.leaf.pos {}",
         c.trans,
         ret.leaf.pos);
+#ifndef NDEBUG
       if (min_depth == 1) {
         ret.assert_valid();
       }
+#endif
       return std::move(ret);
     });
   }