mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Relax memory ordering of operations within the test CountingAlloc
This commit is contained in:
parent
8d0ace2d64
commit
8284bd760f
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue