indexing
	description: ""

deferred class interface
	ROUTINE [TBASE, TOPEN -> TUPLE]

feature -- Access

	C_memory: INTEGER is 2
			-- Code for the C memory managed
			-- by the garbage collector
			-- (from MEM_CONST)

	Eiffel_memory: INTEGER is 1
			-- Code for the Eiffel memory managed
			-- by the garbage collector
			-- (from MEM_CONST)

	Full_collector: INTEGER is 0
			-- Statistics for full collections
			-- (from MEM_CONST)

	Incremental_collector: INTEGER is 1
			-- Statistics for incremental collections
			-- (from MEM_CONST)

	Total_memory: INTEGER is 0
			-- Code for all the memory managed
			-- by the garbage collector
			-- (from MEM_CONST)
	
feature -- Measurement

	gc_statistics (collector_type: INTEGER): GC_INFO
			-- Garbage collection information for collector_type.
			-- (from MEMORY)
		require -- from MEMORY
			type_ok: collector_type = full_collector or collector_type = incremental_collector

	memory_statistics (memory_type: INTEGER): MEM_INFO
			-- Memory usage information for memory_type
			-- (from MEMORY)
		require -- from MEMORY
			type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
	
feature -- Status report

	chunk_size: INTEGER
			-- Minimal size of a memory chunk. The run-time always
			-- allocates a multiple of this size.
			-- (from MEMORY)

	collecting: BOOLEAN
			-- Is garbage collection enabled?
			-- (from MEMORY)

	collection_period: INTEGER
			-- Period of full collection.
			-- (from MEMORY)

	largest_coalesced_block: INTEGER
			-- Size of largest coalesced block since last call to
			-- largest_coalesced; 0 if none.
			-- (from MEMORY)

	max_mem: INTEGER
			-- Maximum amount of bytes the run-time can allocate.
			-- (from MEMORY)

	memory_threshold: INTEGER
			-- Minimum amount of bytes to be allocated before
			-- starting an automatic garbage collection.
			-- (from MEMORY)
	
feature -- Status setting

	allocate_compact
			-- Enter `memory' mode: will try to compact memory
			-- before requesting more from the operating system.
			-- (from MEMORY)

	allocate_fast
			-- Enter `speed' mode: will optimize speed of memory
			-- allocation rather than memory usage.
			-- (from MEMORY)

	allocate_tiny
			-- Enter `tiny' mode: will enter `memory' mode
			-- after having freed as much memory as possible.
			-- (from MEMORY)

	collection_off
			-- Disable garbage collection.
			-- (from MEMORY)

	collection_on
			-- Enable garbage collection.
			-- (from MEMORY)

	disable_time_accounting
			-- Disable GC time accounting (default).
			-- (from MEMORY)

	enable_time_accounting
			-- Enable GC time accouting, accessible in gc_statistics.
			-- (from MEMORY)

	set_chunk_size (value: INTEGER)
			-- Set the minimal size of a memory chunk.
			-- A chunk is an Eiffel memory unit.
			-- (from MEMORY)
		require -- from MEMORY
			positive_value: value > 0

	set_collection_period (value: INTEGER)
			-- Set collection_period. Every value collection,
			-- the Garbage collector will perform a collection
			-- on the whole memory, otherwise a simple partial
			-- collection is done.
			-- (from MEMORY)
		require -- from MEMORY
			positive_value: value > 0

	set_max_mem (value: INTEGER)
			-- Set the maximum amount of memory the run-time can allocate.
			-- (from MEMORY)
		require -- from MEMORY
			positive_value: value > 0

	set_memory_threshold (value: INTEGER)
			-- Set a new memory_threshold in bytes. Whenever the memory
			-- allocated for Eiffel reaches this value, an automatic
			-- collection is performed.
			-- (from MEMORY)
		require -- from MEMORY
			positive_value: value > 0
	
feature -- Removal

	collect
			-- Force a partial collection cycle if garbage
			-- collection is enabled; do nothing otherwise.
			-- (from MEMORY)

	free (object: ANY)
			-- Free object, by-passing garbage collection.
			-- Erratic behavior will result if the object is still
			-- referenced.
			-- (from MEMORY)

	full_coalesce
			-- Coalesce the whole memory: merge adjacent free
			-- blocks to reduce fragmentation. Useful, when
			-- a lot of memory is allocated with garbage collector off.
			-- (from MEMORY)

	full_collect
			-- Force a full collection cycle if garbage
			-- collection is enabled; do nothing otherwise.
			-- (from MEMORY)

	mem_free (addr: POINTER)
			-- Free memory of object at addr.
			-- (Preferred interface is free.)
			-- (from MEMORY)
	
feature -- Duplication

	copy (other: like Current)
		require -- from GENERAL
			other_not_void: other /= void;
			type_identity: same_type (other)
		ensure -- from GENERAL
			is_equal: is_equal (other)
		ensure then
	
feature -- Adaptation

	adapt_from (other: ROUTINE [TBASE, TOPEN])
			-- Adapt Current from other. Useful
			-- in descendants.
		require
			other_exists: other /= void;
			conforming: conforms_to (other)
		ensure
	
feature -- Arguments

	arguments: TOPEN
			-- Open arguments

	set_arguments (args: TOPEN)
			-- Set arguments from args.
		require
			valid_arguments: valid_arguments (args)
	
feature -- Calls

	apply
			-- Call routine with arguments arguments.
		require
			valid_arguments: valid_arguments (arguments);
			callable: callable

	call (args: TOPEN)
			-- Call routine with arguments args.
		require
			valid_arguments: valid_arguments (args);
			callable: callable
	
feature -- Queries

	callable: BOOLEAN
			-- Can a routine call through Current be made?

	is_equal (other: like Current): BOOLEAN
		require -- from GENERAL
			other_not_void: other /= void
		ensure -- from GENERAL
			symmetric: Result implies other.is_equal (Current);
			consistent: standard_is_equal (other) implies Result

	valid_arguments (args: TOPEN): BOOLEAN
			-- Are args valid arguments for this routine?
	
invariant

		-- from GENERAL
	reflexive_equality: standard_is_equal (Current);
	reflexive_conformance: conforms_to (Current);

end -- class ROUTINE