From 8284bd760f601da6c22b76bea61dba9460fec4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Thu, 24 Nov 2022 09:29:10 +0100 Subject: [PATCH] Relax memory ordering of operations within the test CountingAlloc --- milli/src/search/query_tree.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/milli/src/search/query_tree.rs b/milli/src/search/query_tree.rs index 74b244f9a..9d0ca5633 100755 --- a/milli/src/search/query_tree.rs +++ b/milli/src/search/query_tree.rs @@ -1395,14 +1395,14 @@ mod test { } unsafe impl GlobalAlloc for CountingAlloc { unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 { - self.allocated.fetch_add(layout.size() as i64, atomic::Ordering::SeqCst); - self.resident.fetch_add(layout.size() as i64, atomic::Ordering::SeqCst); + self.allocated.fetch_add(layout.size() as i64, atomic::Ordering::Relaxed); + self.resident.fetch_add(layout.size() as i64, atomic::Ordering::Relaxed); System.alloc(layout) } unsafe fn dealloc(&self, ptr: *mut u8, layout: std::alloc::Layout) { - self.resident.fetch_sub(layout.size() as i64, atomic::Ordering::SeqCst); + self.resident.fetch_sub(layout.size() as i64, atomic::Ordering::Relaxed); System.dealloc(ptr, layout) } }