mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 11:42:28 +00:00 
			
		
		
		
	Java API: explain the phantom references mechanics in Javadoc.
This commit is contained in:
		
							parent
							
								
									a914822346
								
							
						
					
					
						commit
						b65d83aacf
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		|  | @ -24,8 +24,17 @@ import java.util.IdentityHashMap; | |||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * A queue to handle management of native memory. | ||||
|  * | ||||
|  * @param <T> | ||||
|  * <p><b>Mechanics: </b>once an object is created, a metadata is stored for it in | ||||
|  * {@code referenceMap}, and a {@link PhantomReference} is created with a | ||||
|  * reference  to {@code referenceQueue}. | ||||
|  * Once the object becomes strongly unreachable, the phantom reference gets | ||||
|  * added by JVM to the {@code referenceQueue}. | ||||
|  * After each object creation, we iterate through the available objects in | ||||
|  * {@code referenceQueue} and decrement references for them. | ||||
|  * | ||||
|  * @param <T> Type of object stored in queue. | ||||
|  */ | ||||
| public abstract class IDecRefQueue<T extends Z3Object> { | ||||
|     private final ReferenceQueue<T> referenceQueue = new ReferenceQueue<>(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue