mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 13:06:05 +00:00
cleanup thread pool of scoped_timer on memory finalize
but keep it alive on Z3_memory_reset()
This commit is contained in:
parent
0213af3c61
commit
4e9035d4b9
5 changed files with 37 additions and 22 deletions
|
@ -27,6 +27,7 @@ Copyright (c) 2015 Microsoft Corporation
|
|||
// rational::finalize();
|
||||
void mem_initialize();
|
||||
void mem_finalize();
|
||||
void finalize_scoped_timer();
|
||||
|
||||
// If PROFILE_MEMORY is defined, Z3 will display the amount of memory used, and the number of synchronization steps during finalization
|
||||
// #define PROFILE_MEMORY
|
||||
|
@ -130,7 +131,7 @@ void memory::set_max_alloc_count(size_t max_count) {
|
|||
|
||||
static bool g_finalizing = false;
|
||||
|
||||
void memory::finalize() {
|
||||
void memory::finalize(bool shutdown) {
|
||||
if (g_memory_initialized) {
|
||||
g_finalizing = true;
|
||||
mem_finalize();
|
||||
|
@ -139,6 +140,10 @@ void memory::finalize() {
|
|||
//delete g_memory_mux;
|
||||
g_memory_initialized = false;
|
||||
g_finalizing = false;
|
||||
|
||||
if (shutdown) {
|
||||
finalize_scoped_timer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue