kou commented on code in PR #42088:
URL: https://github.com/apache/arrow/pull/42088#discussion_r1633977233


##########
swift/Arrow/Sources/Arrow/ArrowCExporter.swift:
##########
@@ -61,12 +61,18 @@ public class ArrowCExporter {
             // deallocated
             self.arrowData = arrowData
             for arrowBuffer in arrowData.buffers {
-                data.append(arrowBuffer.rawPointer)
+                self.data.append(arrowBuffer.rawPointer)
             }
 
-            self.buffers = UnsafeMutablePointer(mutating: data)
+            self.buffers = 
UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: data.count)
+            self.buffers.initialize(from: &data, count: data.count)

Review Comment:
   Should we use `self.data` here too?
   
   ```suggestion
               self.buffers = 
UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: self.data.count)
               self.buffers.initialize(from: &self.data, count: self.data.count)
   ```



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