From 5284f386ee86f333ba546e7befc18690aba10254 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Wed, 12 Jun 2024 16:35:28 -0400 Subject: [PATCH] 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 --- src/debugallocation.cc | 2 ++ 1 file changed, 2 insertions(+) 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; }