MCPcopy Create free account
hub / github.com/apache/brpc / check_memory_leak

Function check_memory_leak

test/iobuf_unittest.cpp:109–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static void check_memory_leak() {
110 if (is_debug_allocator_enabled()) {
111 butil::IOBuf::Block* p = butil::iobuf::get_tls_block_head();
112 size_t n = 0;
113 while (p) {
114 ASSERT_TRUE(s_set.seek(p)) << "Memory leak: " << p;
115 p = butil::iobuf::get_portal_next(p);
116 ++n;
117 }
118 ASSERT_EQ(n, s_set.size());
119 ASSERT_EQ(n, (size_t)butil::iobuf::get_tls_block_count());
120 }
121}
122
123class IOBufTest : public ::testing::Test{
124protected:

Callers 1

TearDownMethod · 0.85

Calls 6

get_tls_block_headFunction · 0.85
get_portal_nextFunction · 0.85
get_tls_block_countFunction · 0.85
seekMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected