From 2b90500c22d4d189260524766cc5867914a9e6ca Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 27 Feb 2025 23:58:38 +0100 Subject: [PATCH] Remove container sanitizer unless using the LIBC allocator. --- lib/std/collections/list.c3 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/collections/list.c3 b/lib/std/collections/list.c3 index c2e1c6bb2..32ea8b59c 100644 --- a/lib/std/collections/list.c3 +++ b/lib/std/collections/list.c3 @@ -394,10 +394,13 @@ fn void List.reserve(&self, usz added) fn void List._update_size_change(&self,usz old_size, usz new_size) { if (old_size == new_size) return; - sanitizer::annotate_contiguous_container(self.entries, + $if env::ADDRESS_SANITIZER: + if (self.allocator.ptr != &allocator::LIBC_ALLOCATOR) return; + sanitizer::annotate_contiguous_container(self.entries, &self.entries[self.capacity], &self.entries[old_size], &self.entries[new_size]); + $endif } <* @require new_size == 0 || self.capacity != 0