Class: RubyVM::RJIT::CPointer::Array
- Inherits:
-
Object
- Object
- RubyVM::RJIT::CPointer::Array
- Defined in:
- lib/ruby_vm/rjit/c_pointer.rb
Overview
Basically Immediate but without #* to skip auto-dereference of structs.
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#[](index) ⇒ Object
Array access.
-
#[]=(index, value) ⇒ Object
Array set.
-
#initialize(addr, type) ⇒ Array
constructor
A new instance of Array.
Constructor Details
#initialize(addr, type) ⇒ Array
Returns a new instance of Array.
247 248 249 250 |
# File 'lib/ruby_vm/rjit/c_pointer.rb', line 247 def initialize(addr, type) @addr = addr @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
243 244 245 |
# File 'lib/ruby_vm/rjit/c_pointer.rb', line 243 def type @type end |
Instance Method Details
#[](index) ⇒ Object
Array access
253 254 255 |
# File 'lib/ruby_vm/rjit/c_pointer.rb', line 253 def [](index) @type.new(@addr)[index] end |
#[]=(index, value) ⇒ Object
Array set
260 261 262 |
# File 'lib/ruby_vm/rjit/c_pointer.rb', line 260 def []=(index, value) @type.new(@addr)[index] = value end |