Class: RubyVM::RJIT::CPointer::Array

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_vm/rjit/c_pointer.rb

Overview

Basically Immediate but without #* to skip auto-dereference of structs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(addr, type) ⇒ Array

Returns a new instance of Array.

Parameters:



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

#typeObject (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

Parameters:



260
261
262
# File 'lib/ruby_vm/rjit/c_pointer.rb', line 260

def []=(index, value)
  @type.new(@addr)[index] = value
end