pitrou commented on a change in pull request #8401:
URL: https://github.com/apache/arrow/pull/8401#discussion_r509592855
##########
File path: rust/arrow/src/memory.rs
##########
@@ -135,6 +135,10 @@ const FALLBACK_ALIGNMENT: usize = 1 << 6;
/// If you use allocation methods shown here you won't have any problems.
const BYPASS_PTR: NonNull<u8> = unsafe { NonNull::new_unchecked(ALIGNMENT as
*mut u8) };
+#[cfg(feature = "memory-check")]
+// If this number is not zero after all objects have been `drop`, there is a
memory leak
+pub static mut ALLOCATIONS: i32 = 0;
Review comment:
It's atomic in C++. It's always compiled in, and I don't think we've
profiled without it. My general intuition is that an atomic increment will be
faster than the allocation itself (an uncontended atomic increment will be a
couple nanoseconds at worse?). Also, it sounds unlikely that an application
would do many buffer allocations per second.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]