Returns a Hash
containing information about the GC.
The contents of the hash are implementation specific and may change in the future without notice.
The hash includes information about internal statistics about GC such as:
The total number of garbage collections ran since application start (count includes both minor and major garbage collections)
The total time spent in garbage collections (in milliseconds)
The total number of :heap_eden_pages
+ :heap_tomb_pages
The number of pages that can fit into the buffer that holds references to all pages
The total number of pages the application could allocate without additional GC
The total number of slots in all :heap_allocated_pages
The total number of slots which contain live objects
The total number of slots which do not contain live objects
The total number of slots with pending finalizers to be run
The total number of objects marked in the last GC
The total number of pages which contain at least one live slot
The total number of pages which do not contain any live slots
The cumulative number of pages allocated since application start
The cumulative number of pages freed since application start
The cumulative number of objects allocated since application start
The cumulative number of objects freed since application start
Amount of memory allocated on the heap for objects. Decreased by any GC
When :malloc_increase_bytes
crosses this limit, GC is triggered
The total number of minor garbage collections run since process start
The total number of major garbage collections run since process start
The total number of compactions run since process start
The total number of times the read barrier was triggered during compaction
The total number of objects compaction has moved
The total number of objects without write barriers
When :remembered_wb_unprotected_objects
crosses this limit, major GC is triggered
Number of live, old objects which have survived at least 3 garbage collections
When :old_objects
crosses this limit, major GC is triggered
Amount of memory allocated on the heap for objects. Decreased by major GC
When :old_malloc_increase_bytes
crosses this limit, major GC is triggered
If the optional argument, hash, is given, it is overwritten and returned. This is intended to avoid probe effect.
This method is only expected to work on CRuby.
Returns a string containing the RFC-2045-compliant Base64-encoding of bin
.
Per RFC 2045, the returned string may contain the URL-unsafe characters +
or /
; see Encoding Character Set above:
Base64.encode64("\xFB\xEF\xBE") # => "++++\n" Base64.encode64("\xFF\xFF\xFF") # => "////\n"
The returned string may include padding; see Padding above.
Base64.encode64('*') # => "Kg==\n"
The returned string ends with a newline character, and if sufficiently long will have one or more embedded newline characters; see Newlines above:
Base64.encode64('*') # => "Kg==\n" Base64.encode64('*' * 46) # => "KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq\nKg==\n"
The string to be encoded may itself contain newlines, which will be encoded as ordinary Base64:
Base64.encode64("\n\n\n") # => "CgoK\n" s = "This is line 1\nThis is line 2\n" Base64.encode64(s) # => "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n"
Returns a string containing the decoding of an RFC-2045-compliant Base64-encoded string str
:
s = "VGhpcyBpcyBsaW5lIDEKVGhpcyBpcyBsaW5lIDIK\n" Base64.decode64(s) # => "This is line 1\nThis is line 2\n"
Non-Base64 characters in str
are ignored; see Encoding Character Set above: these include newline characters and characters -
and /
:
Base64.decode64("\x00\n-_") # => ""
Padding in str
(even if incorrect) is ignored:
Base64.decode64("MDEyMzQ1Njc") # => "01234567" Base64.decode64("MDEyMzQ1Njc=") # => "01234567" Base64.decode64("MDEyMzQ1Njc==") # => "01234567"
Get the default RubyGems API host. This is normally https://rubygems.org
.
Set
the default RubyGems API host.
Get the front object of the current server.
This raises a DRbServerNotFound
error if there is no current server. See current_server
.
Get the front object of the current server.
This raises a DRbServerNotFound
error if there is no current server. See current_server
.
Returns an array of the string names of FileUtils methods that accept one or more keyword arguments:
FileUtils.commands.sort.take(3) # => ["cd", "chdir", "chmod"]
Raises a TypeError
to prevent cloning.
Returns the cosine of x
in radians.
Domain: (-INFINITY, INFINITY)
.
Range: [-1.0, 1.0]
.
Examples:
cos(-PI) # => -1.0 cos(-PI/2) # => 6.123031769111886e-17 # 0.0000000000000001 cos(0.0) # => 1.0 cos(PI/2) # => 6.123031769111886e-17 # 0.0000000000000001 cos(PI) # => -1.0
Returns the arc cosine of x
.
Domain: [-1, 1]
.
Range: [0, PI]
.
Examples:
acos(-1.0) # => 3.141592653589793 # PI acos(0.0) # => 1.5707963267948966 # PI/2 acos(1.0) # => 0.0
Returns the hyperbolic cosine of x
in radians.
Domain: [-INFINITY, INFINITY]
.
Range: [1, INFINITY]
.
Examples:
cosh(-INFINITY) # => Infinity cosh(0.0) # => 1.0 cosh(INFINITY) # => Infinity
Returns the inverse hyperbolic cosine of x
.
Domain: [1, INFINITY]
.
Range: [0, INFINITY]
.
Examples:
acosh(1.0) # => 0.0 acosh(INFINITY) # => Infinity
Returns a list of signal names mapped to the corresponding underlying signal numbers.
Signal.list #=> {"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "IOT"=>6, "ABRT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
Dispatch enter and leave events for RequiredKeywordParameterNode
nodes and continue walking the tree.
Copy a RequiredKeywordParameterNode
node