summaryrefslogtreecommitdiff
path: root/lib/ruby_vm
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2023-03-05 13:00:34 -0800
committerGitHub <noreply@github.com>2023-03-05 13:00:34 -0800
commitfc5482d0889f174f39395048352e7a2a88b133ec (patch)
tree8e7860b4a129f599703112417e51b152aaa658c3 /lib/ruby_vm
parent1b4c1492c1704407f86af2882efebc047b9c2d26 (diff)
Expose the address of MJIT Pointers (#7446)
This way we can manually dereference pointers with Fiddle
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'lib/ruby_vm')
-rw-r--r--lib/ruby_vm/mjit/c_pointer.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ruby_vm/mjit/c_pointer.rb b/lib/ruby_vm/mjit/c_pointer.rb
index de45c171c3..743003f230 100644
--- a/lib/ruby_vm/mjit/c_pointer.rb
+++ b/lib/ruby_vm/mjit/c_pointer.rb
@@ -253,6 +253,11 @@ module RubyVM::MJIT # :nodoc: all
[value.to_i].pack(Fiddle::PackInfo::PACK_MAP[Fiddle::TYPE_VOIDP])
end
+ # Get a raw address
+ def to_i
+ @addr
+ end
+
private
def dest_addr