| 
									
										
										
										
											2009-10-07 16:48:09 -04:00
										 |  |  | namespace factor | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct aging_policy { | 
					
						
							| 
									
										
										
										
											2009-10-18 21:31:59 -04:00
										 |  |  | 	factor_vm *parent; | 
					
						
							| 
									
										
										
										
											2009-10-20 16:15:05 -04:00
										 |  |  | 	aging_space *aging; | 
					
						
							|  |  |  | 	tenured_space *tenured; | 
					
						
							| 
									
										
										
										
											2009-10-07 16:48:09 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-25 00:02:58 -04:00
										 |  |  | 	explicit aging_policy(factor_vm *parent_) : | 
					
						
							| 
									
										
										
										
											2009-10-18 21:31:59 -04:00
										 |  |  | 		parent(parent_), | 
					
						
							|  |  |  | 		aging(parent->data->aging), | 
					
						
							|  |  |  | 		tenured(parent->data->tenured) {} | 
					
						
							| 
									
										
										
										
											2009-10-07 16:48:09 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bool should_copy_p(object *untagged) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return !(aging->contains_p(untagged) || tenured->contains_p(untagged)); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2009-10-20 23:20:49 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void promoted_object(object *obj) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void visited_object(object *obj) {} | 
					
						
							| 
									
										
										
										
											2009-10-07 16:48:09 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct aging_collector : copying_collector<aging_space,aging_policy> { | 
					
						
							| 
									
										
										
										
											2009-10-25 00:02:58 -04:00
										 |  |  | 	explicit aging_collector(factor_vm *parent_); | 
					
						
							| 
									
										
										
										
											2009-10-07 16:48:09 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |