40 lines
		
	
	
		
			912 B
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
			
		
		
	
	
			40 lines
		
	
	
		
			912 B
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
namespace factor
 | 
						|
{
 | 
						|
 | 
						|
struct code_heap {
 | 
						|
	/* The actual memory area */
 | 
						|
	segment *seg;
 | 
						|
 | 
						|
	/* Memory allocator */
 | 
						|
	free_list_allocator<code_block> *allocator;
 | 
						|
 | 
						|
	/* Set of blocks which need full relocation. */
 | 
						|
	std::set<code_block *> needs_fixup;
 | 
						|
 | 
						|
	/* Code blocks which may reference objects in the nursery */
 | 
						|
	std::set<code_block *> points_to_nursery;
 | 
						|
 | 
						|
	/* Code blocks which may reference objects in aging space or the nursery */
 | 
						|
	std::set<code_block *> points_to_aging;
 | 
						|
 | 
						|
	explicit code_heap(cell size);
 | 
						|
	~code_heap();
 | 
						|
	void write_barrier(code_block *compiled);
 | 
						|
	void clear_remembered_set();
 | 
						|
	bool needs_fixup_p(code_block *compiled);
 | 
						|
	bool marked_p(code_block *compiled);
 | 
						|
	void set_marked_p(code_block *compiled);
 | 
						|
	void clear_mark_bits();
 | 
						|
	void code_heap_free(code_block *compiled);
 | 
						|
};
 | 
						|
 | 
						|
struct code_heap_room {
 | 
						|
	cell size;
 | 
						|
	cell occupied_space;
 | 
						|
	cell total_free;
 | 
						|
	cell contiguous_free;
 | 
						|
	cell free_block_count;
 | 
						|
};
 | 
						|
 | 
						|
}
 |