You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reading through your code I can't see how your Nifty Counter approach clears up the temporary allocators safely . As the temporary_allocator_dtor_t instances are only static and not thread local themselves, their destructors will only be called at program exit and only on one thread. The temporary_allocator_dtor_t thread local data members will only be accessed on that one thread - so their is no point in them being thread local. Any allocators on other threads, including threads that are killed mid program will never be deallocated.
Perhaps my understanding of your solution is wrong.
Nice library, by the way.
The text was updated successfully, but these errors were encountered:
I remember finding the issue and thought I've fixed it.
I think you are right, the dtor_t needs to be thread_local as well, but the GCC __thread keyword that is used for older versions doesn't support thread local objects with non-trivial destructor, so they can't be.
Hi,
Reading through your code I can't see how your Nifty Counter approach clears up the temporary allocators safely . As the temporary_allocator_dtor_t instances are only static and not thread local themselves, their destructors will only be called at program exit and only on one thread. The temporary_allocator_dtor_t thread local data members will only be accessed on that one thread - so their is no point in them being thread local. Any allocators on other threads, including threads that are killed mid program will never be deallocated.
Perhaps my understanding of your solution is wrong.
Nice library, by the way.
The text was updated successfully, but these errors were encountered: