class RubyVM::RJIT::CPointer::Array

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

Attributes

type[R]

Public Class Methods

new(addr, type) click to toggle source

@param addr [Integer] @param type [Class] RubyVM::RJIT::CType::*

# File ruby_vm/rjit/c_pointer.rb, line 247
def initialize(addr, type)
  @addr = addr
  @type = type
end

Private Class Methods

define(block) click to toggle source
Calls superclass method
# File ruby_vm/rjit/c_pointer.rb, line 266
def self.define(block)
  Class.new(self) do
    define_method(:initialize) do |addr|
      super(addr, block.call)
    end
  end
end

Public Instance Methods

[](index) click to toggle source

Array access

# File ruby_vm/rjit/c_pointer.rb, line 253
def [](index)
  @type.new(@addr)[index]
end
[]=(index, value) click to toggle source

Array set @param index [Integer] @param value [Integer, RubyVM::RJIT::CPointer::Struct] an address itself or an object that return an address with to_i

# File ruby_vm/rjit/c_pointer.rb, line 260
def []=(index, value)
  @type.new(@addr)[index] = value
end