diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-04-03 21:24:47 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-10-17 11:30:35 -0400 |
commit | 1f7234c0152df5dcf9a73acb352d20fcd3004ddf (patch) | |
tree | 65218828f1606fde8f4bb0621c61df754ac8084d /yjit/bindgen/src/main.rs | |
parent | 01b5d1d2ff6ca91b2909dfa67295f59b53e6f065 (diff) | |
download | ruby-1f7234c0152df5dcf9a73acb352d20fcd3004ddf.tar.gz |
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.
Diffstat (limited to 'yjit/bindgen/src/main.rs')
-rw-r--r-- | yjit/bindgen/src/main.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index c87dc6fb21..359d5ccb9c 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -208,6 +208,7 @@ fn main() { // From include/ruby/internal/symbol.h .allowlist_function("rb_intern") + .allowlist_function("rb_intern2") .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") |