jorgecarleitao commented on a change in pull request #8401:
URL: https://github.com/apache/arrow/pull/8401#discussion_r509588774



##########
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:
       I think so: I was just not very confident with the note
   
   > Note: This type is only available on platforms that support atomic loads 
and stores of usize.
   
   which I do not know how many / which platforms we would risk with this.
   
   I am also not sure if we should just remove the feature gate and use it. It 
certainly makes the CI easier, as we do not have to compile it again. Any 
thoughts @nevi-me @paddyhoran ?
   
    @pitrou did you ever profiled the C++ code with and without the allocation 
counter (is it atomic there?)?




----------------------------------------------------------------
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]


Reply via email to