pixelherodev commented on PR #322:
URL: https://github.com/apache/arrow-go/pull/322#issuecomment-3500542577

   Copying from #269:
   
   > The two problems with totally dropping retain/release:
   
   > 1. AddCleanup is non-deterministic on when it runs, so for situations 
where the user is using a custom allocator (instead of the default Go 
allocator) we'd still want to make sure that the Retain/Release paradigm allows 
users to control when memory is freed
   > 2. It's also not guaranteed to run before program exit, which may not be a 
problem given that typically it's just calling Free on some allocations so 
maybe this isn't an issue.
   
   2 is a non-issue IMO. The non-determinism of 1 is also, I think, a bit 
overstated? AddCleanup is allowed to batch cleanups but the documentation says 
this is only likely to happen with objects that are less than sixteen bytes 
_and_ that do not contain pointers, neither of which applies to most of the 
types currently using Retain/Release.
   
   _Practically_ speaking, the cleanups will most likely run within 1 or 2 GC 
cycles. Are there cases where this is insufficient?


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