Expose pthread feature flag
The code was able to use pthread destructors rather than C++ thread local destructors. This removes the dependence on a C++ .so on linux. However, this is not stable on other platforms such as Apple. Where the C++ thread local state can be cleared before the pthread destructor runs.
This commit is contained in:
committed by
Matthew Parkinson
parent
ea90f7b9c2
commit
b52e2a6e27
@@ -19,6 +19,7 @@
|
||||
# if defined(SNMALLOC_THREAD_TEARDOWN_DEFINED)
|
||||
# error At most one out of method of thread teardown can be specified.
|
||||
# else
|
||||
# include <pthread.h>
|
||||
# define SNMALLOC_THREAD_TEARDOWN_DEFINED
|
||||
# endif
|
||||
#endif
|
||||
@@ -95,7 +96,7 @@ namespace snmalloc
|
||||
}
|
||||
};
|
||||
|
||||
# ifdef SNMALLOC_USE_PTHREAD_DESTRUCTOR
|
||||
# ifdef SNMALLOC_USE_PTHREAD_DESTRUCTORS
|
||||
/**
|
||||
* Used to give correct signature to teardown required by pthread_key.
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#ifdef SNMALLOC_USE_PTHREAD_DESTRUCTORS
|
||||
# undef SNMALLOC_USE_PTHREAD_DESTRUCTORS
|
||||
#endif
|
||||
|
||||
#include <snmalloc_core.h>
|
||||
#include <test/setup.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user