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
This commit is contained in:
Aliaksey Kandratsenka 2024-06-12 16:35:28 -04:00
parent 778df41889
commit 5284f386ee
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}