Before, the buffer is inside my struct and those are reclaimed whenever objects are GC-ed.
If I used task_local_storage, the buffer would accumulate infinitely on the main task, should I use finalize()
to clear out the task_local_storage()[key]
manually? Or we don’t know the fianlizer will always be on the main task?
(the other tasks I don’t have to worry about because their task local storage will be cleared out when they get GC-ed)