aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2024-06-12 16:35:28 -0400
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2024-06-12 16:42:29 -0400
commit5284f386ee86f333ba546e7befc18690aba10254 (patch)
tree584cdf6cef068a93e1bed62e626b359f228d469a
parent778df41889eb562bb5e7e64526824a2604d832f9 (diff)
downloadgoogle-perftools-5284f386ee86f333ba546e7befc18690aba10254.tar.gz
google-perftools-5284f386ee86f333ba546e7befc18690aba10254.zip
allow disabling actual versus given sized delete checking
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279560#c10 and https://github.com/llvm/llvm-project/pull/90292
-rw-r--r--src/debugallocation.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/debugallocation.cc b/src/debugallocation.cc
index d5c8386..dc2ac80 100644
--- a/src/debugallocation.cc
+++ b/src/debugallocation.cc
@@ -414,8 +414,10 @@ class MallocBlock {
alloc_map_lock_.Unlock();
// clear us
const size_t size = real_size();
+#if !defined(TCMALLOC_DONT_VERIFY_SIZE)
RAW_CHECK(!given_size || given_size == size1_,
"right size must be passed to sized delete");
+#endif
memset(this, kMagicDeletedByte, size);
return size;
}