bit2swaz commented on PR #10431: URL: https://github.com/apache/arrow-rs/pull/10431#issuecomment-5090645245
right, thanks for bringing that up. i can see that #9772 made these `pub` on purpose for @ashdnazg's cross-thread use case in #9771 so this PR as is reverts that i think both goals can coexist tho. the only soundness relevant fields are `release` and `private_data` since those are what `Drop` calls. the plain data fields being `pub` is harmless. and the thing #9771 actually needs, wrapping `release` + `private_data` with your own, is an `unsafe` operation anyway since youre taking over memory ownership one direction i think would suit this would be to make the fields private and give back that one capability through a small `unsafe` API in the same spirit as `from_raw`. exact shape depends on how @ashdnazg actually uses it @ashdnazg do you mutate the struct in place (swap `release` + `private_data` on an existing one) or do you take it apart and rebuild with your own release? and do you need the originals read back out? that would decide whether this wants an unsafe swap method or an unsafe "from parts" constructor. happy to build whichever fits :) -- 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]
