Jefffrey commented on code in PR #12121:
URL: https://github.com/apache/arrow-rs/pull/12121#discussion_r4558883597


##########
arrow-data/src/data.rs:
##########
@@ -2683,6 +2695,95 @@ mod tests {
         assert!(build(vec![true, true, false, true]).is_err());
     }
 
+    const ROWS: usize = 8;
+    const LIST_SIZE: i32 = 8192;
+    const EXPANDED_BYTES: usize = ROWS * LIST_SIZE as usize / 8;
+
+    thread_local! {
+        static FAIL_EXPANSION: Cell<bool> = const { Cell::new(false) };
+    }
+
+    struct FailingAllocator;
+
+    #[global_allocator]
+    static ALLOCATOR: FailingAllocator = FailingAllocator;
+
+    // SAFETY: Successful allocations and all deallocations are delegated to 
System.
+    unsafe impl GlobalAlloc for FailingAllocator {

Review Comment:
   this machinery seems quite overkill; we could probably have a single test 
with fixedsizelist of null array, and this should fail on main with allocation 
error (make the length big) but succeed on this PR as it should avoid the 
allocation



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to