From: "nobu (Nobuyoshi Nakada) via ruby-core" Date: 2026-07-31T11:36:08+00:00 Subject: [ruby-core:126215] [Ruby Feature#22222] Expose a C API equivalent of `RubyVM::InstructionSequence.load_from_binary` Issue #22222 has been updated by nobu (Nobuyoshi Nakada). The only requirements for `rb_str_new_static` are that the caller is responsible for freeing the allocated memory, and that the memory is not freed while the object is still in existence. You can think of it as requiring the same level of care as when passing a buffer to a system call. The term ���static��� essentially means that the memory is stable from the perspective of this function. ---------------------------------------- Feature #22222: Expose a C API equivalent of `RubyVM::InstructionSequence.load_from_binary` https://bugs.ruby-lang.org/issues/22222#change-118297 * Author: byroot (Jean Boussier) * Status: Open ---------------------------------------- Currently the only API to deserialize instruction sequence is `RubyVM::InstructionSequence.load_from_binary(String)`. It works fine, but isn't ideal for gems like bootsnap, as it needs to allocate a fairly large string and `memcpy` into it. I would like to be able to directly pass a `char *ptr` and `size_t len` pair, so that I can directly pass a internal buffer or even mmapped file. Proposed API: ``` VALUE rb_iseq_load_from_binary(const char *ptr, size_t len) ``` Pull request: https://github.com/ruby/ruby/pull/18136 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/