note
	description: "[
		Properties of the memory management mechanism.
		This class may be used as ancestor by classes needing its facilities.
	]"
	library: "Free implementation of ELKS library"
	status: "See notice at end of class."
	legal: "See notice at end of class."
	date: "$Date: 2017-12-26 18:35:31 +0000 (Tue, 26 Dec 2017) $"
	revision: "$Revision: 101217 $"

class interface
	MEM_INFO

create 
	make

feature -- Initialization

	make (memory: INTEGER_32)
			-- Update Current for memory type.
		require
			memory_valid: memory = Total_memory or memory = Eiffel_memory or memory = C_memory
		ensure
			type_set: type = memory

	update (memory: INTEGER_32)
			-- Update Current for memory type.
		require
			memory_valid: memory = Total_memory or memory = Eiffel_memory or memory = C_memory
		ensure
			type_set: type = memory
	
feature -- Access

	type: INTEGER_32
			-- Memory type (Total, Eiffel, C)
	
feature -- Measurement

	total: INTEGER_32
			-- Total number of bytes allocated for type
			-- before last call to update

	used: INTEGER_32
			-- Number of bytes used for type
			-- before last call to update

	free: INTEGER_32
			-- Number of bytes still free for type
			-- before last call to update
		ensure
			computed: Result = total - used - overhead

	overhead: INTEGER_32
			-- Number of bytes used by memory management
			-- scheme for type before last call to update

	chunk: INTEGER_32
			-- Number of allocated memory chunks
	
feature -- Extended measurement

	total64: NATURAL_64
			-- Total number of bytes allocated for type
			-- before last call to update

	used64: NATURAL_64
			-- Number of bytes used for type
			-- before last call to update

	free64: NATURAL_64
			-- Number of bytes still free for type
			-- before last call to update

	overhead64: NATURAL_64
			-- Number of bytes used by memory management
			-- scheme for type before last call to update
	
feature -- Implementation

	structure_size: INTEGER_32
			-- Size of underlying C structure.
	
invariant
	consistent_memory: total64 = free64 + used64 + overhead64

note
	copyright: "Copyright (c) 1984-2017, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class MEM_INFO

Generated by ISE EiffelStudio