mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 11:42:28 +00:00 
			
		
		
		
	adding threads to smt core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									d4a24aff1e
								
							
						
					
					
						commit
						5f2720562b
					
				
					 11 changed files with 68 additions and 22 deletions
				
			
		|  | @ -196,9 +196,15 @@ class mpz_manager { | |||
|     mutable mpz_t     m_int64_min; | ||||
| 
 | ||||
|     mpz_t * allocate() {         | ||||
|         MPZ_BEGIN_CRITICAL(); | ||||
|         mpz_t * cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t))); | ||||
|         MPZ_END_CRITICAL(); | ||||
| #ifdef SINGLE_THREAD | ||||
|         mpz_t * cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));         | ||||
| #else | ||||
| #if SYNC | ||||
|         mpz_t * cell = reinterpret_cast<mpz_t*>(memory::allocate(sizeof(mpz_t))); | ||||
| #else | ||||
|         mpz_t * cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));         | ||||
| #endif | ||||
| #endif | ||||
|         mpz_init(*cell); | ||||
|         return cell; | ||||
|     } | ||||
|  | @ -206,9 +212,15 @@ class mpz_manager { | |||
|     void deallocate(bool is_heap, mpz_t * ptr) {  | ||||
|         mpz_clear(*ptr);  | ||||
|         if (is_heap) { | ||||
|             MPZ_BEGIN_CRITICAL(); | ||||
| #ifdef SINGLE_THREAD | ||||
|             m_allocator.deallocate(sizeof(mpz_t), ptr);  | ||||
|             MPZ_END_CRITICAL(); | ||||
| #else | ||||
| #if SYNC | ||||
|             memory::deallocate(ptr); | ||||
| #else | ||||
|             m_allocator.deallocate(sizeof(mpz_t), ptr);  | ||||
| #endif | ||||
| #endif | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue