[]=

gdbm[key]= value â value Instance Public methods Associates the value value with the specified key.

[]

gdbm[key] â value Instance Public methods Retrieves the value corresponding to key.

open

GDBM.open(filename, mode = 0666, flags = nil)GDBM.open(filename, mode = 0666, flags = nil) { |gdbm| ... } Class Public methods If called without a block, this is synonymous to ::new. If a block is given, the new GDBM instance will be passed to the block as a parameter, and the corresponding database file will be closed after the execution of the block code has been finished. Example for an open call with a block: require 'gdbm' GDBM.open("fruitstore.db") do |gdbm| gdbm.each_pair

new

GDBM.new(filename, mode = 0666, flags = nil) Class Public methods Creates a new GDBM instance by opening a gdbm file named filename. If the file does not exist, a new file with file mode mode will be created. flags may be one of the following: READER - open as a reader WRITER - open as a writer WRCREAT - open as a writer; if the database does not exist, create a new one NEWDB - open as a writer; overwrite any existing databases The values WRITER, WRCREAT and NEWDB ma

garbage_collect

gc.garbage_collect â nilObjectSpace.garbage_collect â nil Instance Public methods Initiates garbage collection, unless manually disabled.

stress=

GC.stress = bool â bool Class Public methods Updates the GC stress mode. When stress mode is enabled, the GC is invoked at every GC opportunity: all memory and object allocations. Enabling stress mode will degrade performance, it is only for debugging.

stress

GC.stress â true or false Class Public methods Returns current status of GC stress mode.

stat

GC.stat â Hash Class Public methods Returns a Hash containing information about the GC. The hash includes information about internal statistics about GC such as: { :count=>0, :heap_used=>12, :heap_length=>12, :heap_increment=>0, :heap_live_num=>7539, :heap_free_num=>88, :heap_final_num=>0, :total_allocated_object=>7630, :total_freed_object=>88 } The contents of the hash are implementation specific and may be changed i

start

GC.start â nil Class Public methods Initiates garbage collection, unless manually disabled.

malloc_allocations

GC.malloc_allocations â Integer Class Public methods Returns the number of malloc() allocations. Only available if ruby was built with CALC_EXACT_MALLOC_SIZE.