viirya commented on issue #40038: URL: https://github.com/apache/arrow/issues/40038#issuecomment-1940350746
Ah, after deeper debugging today, I found we were misled by `sun.misc.Unsafe.allocateMemory` API document. > Allocates a new block of native memory, of the given size in bytes. ... The resulting native pointer will never be zero,... But as I debugged it today, it actually returns zero value pointer. So it causes the Rust arrow think of it a NULL pointer. And, there is an update to the API document: https://github.com/openjdk/jdk/commit/209d87a856b1a7bd60910b517d8ff5beb322ec0b It is changed to: > The resulting native pointer will be zero if and only if the requested size is zero. So once `UnsafeAllocationManager` is used , these empty buffers could be treated as NULL pointers actually when they are exported. cc @lidavidm @pitrou -- 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]
