There are two ways a buffer can be deallocated.
- Explicitly via calling Buffer.close()
|
def close(self, stream: Stream = None): |
- Implicitly via finalizer
|
weakref.finalize(buffer_obj, self.close) |
In the implicit case, no stream= argument is passed to the finalizer function, which means that if a buffer gets refcounted out or gc'd, it will always be deallocated on the default stream.
Possibly we want to change this so that the stream passed to the mr.allocate() function is used for deallocation by default.
There are two ways a buffer can be deallocated.
cuda-python/cuda_core/cuda/core/experimental/_memory.py
Line 63 in ae1cbcf
cuda-python/cuda_core/cuda/core/experimental/_memory.py
Line 43 in ae1cbcf
In the implicit case, no
stream=argument is passed to the finalizer function, which means that if a buffer gets refcounted out or gc'd, it will always be deallocated on the default stream.Possibly we want to change this so that the
streampassed to themr.allocate()function is used for deallocation by default.