This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 97a34e49 Update dist/ for commit 
36a263719ec7cc8438ff8fa21942426ca2763f95
97a34e49 is described below

commit 97a34e49e732f2033baf34a711e285fda2ceb31a
Author: GitHub Actions <[email protected]>
AuthorDate: Tue Feb 20 01:24:44 2024 +0000

    Update dist/ for commit 36a263719ec7cc8438ff8fa21942426ca2763f95
---
 dist/nanoarrow.c | 8 ++++++++
 dist/nanoarrow.h | 9 +++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/dist/nanoarrow.c b/dist/nanoarrow.c
index 118df76c..d7925587 100644
--- a/dist/nanoarrow.c
+++ b/dist/nanoarrow.c
@@ -2919,6 +2919,10 @@ static int ArrowArrayViewValidateDefault(struct 
ArrowArrayView* array_view,
                         (long)array_view->buffer_views[2].size_bytes);
           return EINVAL;
         }
+      } else if (array_view->buffer_views[2].size_bytes == -1) {
+        // If the data buffer size is unknown and there are no bytes in the 
offset buffer,
+        // set the data buffer size to 0.
+        array_view->buffer_views[2].size_bytes = 0;
       }
       break;
 
@@ -2945,6 +2949,10 @@ static int ArrowArrayViewValidateDefault(struct 
ArrowArrayView* array_view,
                         (long)array_view->buffer_views[2].size_bytes);
           return EINVAL;
         }
+      } else if (array_view->buffer_views[2].size_bytes == -1) {
+        // If the data buffer size is unknown and there are no bytes in the 
offset
+        // buffer, set the data buffer size to 0.
+        array_view->buffer_views[2].size_bytes = 0;
       }
       break;
 
diff --git a/dist/nanoarrow.h b/dist/nanoarrow.h
index a7027366..8d62ac64 100644
--- a/dist/nanoarrow.h
+++ b/dist/nanoarrow.h
@@ -721,6 +721,9 @@ struct ArrowBufferAllocator {
   void* private_data;
 };
 
+typedef void (*ArrowBufferDeallocatorCallback)(struct ArrowBufferAllocator* 
allocator,
+                                               uint8_t* ptr, int64_t size);
+
 /// \brief An owning mutable view of a buffer
 /// \ingroup nanoarrow-buffer
 struct ArrowBuffer {
@@ -1168,10 +1171,8 @@ struct ArrowBufferAllocator 
ArrowBufferAllocatorDefault(void);
 /// attach a custom deallocator to an ArrowBuffer. This may be used to
 /// avoid copying an existing buffer that was not allocated using the
 /// infrastructure provided here (e.g., by an R or Python object).
-struct ArrowBufferAllocator ArrowBufferDeallocator(
-    void (*custom_free)(struct ArrowBufferAllocator* allocator, uint8_t* ptr,
-                        int64_t size),
-    void* private_data);
+struct ArrowBufferAllocator 
ArrowBufferDeallocator(ArrowBufferDeallocatorCallback,
+                                                   void* private_data);
 
 /// @}
 

Reply via email to