diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-11 21:31:18 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-11 21:48:28 -0800 |
commit | 50c5f94ed71707030f03ef1ce699367f021e0aa3 (patch) | |
tree | fc3fcf963d0e955288354682c09f6eb4ad082058 /rjit_c.rb | |
parent | 58f7e8b7f83babeefb39d1a919d43de237c36c8a (diff) | |
download | ruby-50c5f94ed71707030f03ef1ce699367f021e0aa3.tar.gz |
RJIT: Introduce constants under RubyVM::RJIT::C
Diffstat (limited to 'rjit_c.rb')
-rw-r--r-- | rjit_c.rb | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -2,9 +2,9 @@ # Part of this file is generated by tool/rjit/bindgen.rb. # Run `make rjit-bindgen` to update code between "RJIT bindgen begin" and "RJIT bindgen end". module RubyVM::RJIT # :nodoc: all - # This `class << C` section is for calling C functions. For importing variables - # or macros as is, please consider using tool/rjit/bindgen.rb instead. - class << C = Object.new + # This `class << C` section is for calling C functions with Primitive. + # For importing variables or macros, use tool/rjit/bindgen.rb instead. + class << C = Module.new def mmap(mem_size) Primitive.cexpr! 'SIZET2NUM((size_t)rjit_reserve_addr_space(NUM2UINT(mem_size)))' end @@ -312,13 +312,8 @@ module RubyVM::RJIT # :nodoc: all ### RJIT bindgen begin ### - def C.VM_ENV_DATA_INDEX_ME_CREF - Primitive.cexpr! %q{ LONG2NUM(VM_ENV_DATA_INDEX_ME_CREF) } - end - - def C.VM_ENV_DATA_INDEX_SPECVAL - Primitive.cexpr! %q{ LONG2NUM(VM_ENV_DATA_INDEX_SPECVAL) } - end + C::VM_ENV_DATA_INDEX_ME_CREF = Primitive.cexpr! %q{ LONG2NUM(VM_ENV_DATA_INDEX_ME_CREF) } + C::VM_ENV_DATA_INDEX_SPECVAL = Primitive.cexpr! %q{ LONG2NUM(VM_ENV_DATA_INDEX_SPECVAL) } def C.ARRAY_REDEFINED_OP_FLAG Primitive.cexpr! %q{ SIZET2NUM(ARRAY_REDEFINED_OP_FLAG) } |