summaryrefslogtreecommitdiff
path: root/yjit/bindgen/src/main.rs
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2023-04-03 21:24:47 -0400
committerAlan Wu <[email protected]>2023-10-17 11:30:35 -0400
commit1f7234c0152df5dcf9a73acb352d20fcd3004ddf ()
tree65218828f1606fde8f4bb0621c61df754ac8084d /yjit/bindgen/src/main.rs
parent01b5d1d2ff6ca91b2909dfa67295f59b53e6f065 (diff)
YJIT: Lookup IDs on boot instead of binding to them
Previously, the version-controlled `cruby_bindings.inc.rs` file contained the build-time artifact `id.h`, which nobu mentioned hinders the goal of having fewer magic numbers in the repository. Lookup the IDs YJIT needs on boot. It costs cycles, but it's fine since YJIT only uses a handful of IDs at the moment. No perceptible degradation to boot time found in my testing.
-rw-r--r--yjit/bindgen/src/main.rs4
1 files changed, 1 insertions, 3 deletions
@@ -208,6 +208,7 @@ fn main() {
// From include/ruby/internal/symbol.h
.allowlist_function("rb_intern")
.allowlist_function("rb_id2sym")
.allowlist_function("rb_id2name")
.allowlist_function("rb_sym2id")
@@ -244,9 +245,6 @@ fn main() {
// From include/ruby/internal/hash.h
.allowlist_type("ruby_rhash_flags") // really old C extension API
- // Autogenerated into id.h
- .allowlist_type("ruby_method_ids")
-
// From method.h
.allowlist_type("rb_method_visibility_t")
.allowlist_type("rb_method_type_t")