3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

Merge pull request #2003 from waywardmonkeys/use-thread_local-storage-specifier

Use C++11 thread_local for portability.
This commit is contained in:
Nikolaj Bjorner 2018-12-02 12:32:01 -05:00 committed by GitHub
commit 8fc75f59b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -241,15 +241,8 @@ void * memory::allocate(char const* file, int line, char const* obj, size_t s) {
// when the local counter > SYNCH_THRESHOLD
#define SYNCH_THRESHOLD 100000
#ifdef _WINDOWS
// Actually this is VS specific instead of Windows specific.
__declspec(thread) long long g_memory_thread_alloc_size = 0;
__declspec(thread) long long g_memory_thread_alloc_count = 0;
#else
// GCC style
__thread long long g_memory_thread_alloc_size = 0;
__thread long long g_memory_thread_alloc_count = 0;
#endif
thread_local long long g_memory_thread_alloc_size = 0;
thread_local long long g_memory_thread_alloc_count = 0;
static void synchronize_counters(bool allocating) {
#ifdef PROFILE_MEMORY