class Emfrp::Alloc
Attributes
h[R]
Public Class Methods
empty()
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 180 def self.empty self.new({}) end
new(hash)
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 176 def initialize(hash) @h = hash end
one(k)
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 184 def self.one(k) self.new(k => 1) end
Public Instance Methods
&(other)
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 192 def &(other) Alloc.new self.h.merge(other.h){|k, v1, v2| v1 + v2} end
each(&block)
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 196 def each(&block) @h.each(&block) end
|(other)
click to toggle source
# File lib/emfrp/compile/c/alloc.rb, line 188 def |(other) Alloc.new self.h.merge(other.h){|k, v1, v2| [v1, v2].max} end