zeroshade commented on PR #578:
URL: https://github.com/apache/arrow-go/pull/578#issuecomment-3573245896
I'm not a fan of this approach. I dislike the users having to call
*multiple* functions as opposed to just having `Retain` and `Release` (i.e. I
don't like having to call the `Referenced` and keep track of Derived etc.)
In theory, a buffer need only keep track of its parent (if it has one) and
doesn't need to keep track of any other buffers which were sliced off from it.
I don't understand the need/desire for adding the pointers that you're doing as
opposed to just having the `atomic.Int64` and essentially putting that behind a
struct which can have a version that is empty for turning off the refcounts.
i.e. Why isn't it just something like:
```go
//go:build !norc
type RefCount struct {
ref atomic.Int64
cleanup func()
}
func (r *RefCount) Retain() {
...
}
func (r *RefCount) Release() {
...
}
/////////////////////
//go:build norc
type RefCount struct {}
func (*RefCount) Retain() {}
func (*RefCount) Release() {}
```
--
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]