summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi
AgeCommit message (Collapse)Author
2025-12-26Remove `rb_iterate` deprecated since 1.9Nobuyoshi Nakada
2025-12-19Just passing FDs does not need to create IO objectsNobuyoshi Nakada
2025-12-10Add `NUM2PTR` and `PTR2NUM` macrosNobuyoshi Nakada
These macros have been defined here and there, so collect them.
2025-12-04Deprecate `rb_eval_cmd_kw`Nobuyoshi Nakada
2025-11-19Update to ruby/spec@6e62695Benoit Daloze
2025-11-19Update to ruby/spec@2e11d2aCharles Oliver Nutter
2025-10-08Update to ruby/spec@3d7e563Benoit Daloze
2025-09-16Fix a function name typo in the description [ci skip]Nobuyoshi Nakada
2025-09-12Fix use of uninitialized memory in stringsPeter Zhu
Strings created from the C API with a len but no ptr have a buffer allocated and the length set, but the buffer is not zero'd. This causes use of uninitialized memory and allows reading memory that previously existed there. For example, the rb_str_tmp_new spec fails when we create a string with a large length greater than 24 bytes (since we zero the first 24 bytes of the slot).
2025-09-11Don't load set_spec.c if not Ruby 3.5Peter Zhu
2025-09-11Fix compilation of set_spec.c for previous Ruby versionsPeter Zhu
Set was moved to C only in Ruby 3.5, so it does not compile on Ruby 3.4 and earlier.
2025-07-11Add Set C-APIJeremy Evans
This should be a minimal C-API needed to deal with Set objects. It supports creating the sets, checking whether an element is the set, adding and removing elements, iterating over the elements, clearing a set, and returning the size of the set. Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
2025-06-16[Bug #20998] Check if the string is frozen in rb_str_locktmp() & ↵Benoit Daloze
rb_str_unlocktmp() Notes: Merged: https://github.com/ruby/ruby/pull/13615
2025-06-15Skip the optional capi digest specs if fiddle is not installedJeremy Evans
Should fix a failure on the OpenBSD RubyCI machine. Notes: Merged: https://github.com/ruby/ruby/pull/13616
2025-06-04Mark as NORETURNNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13509
2025-06-02Update to ruby/spec@4d2fc4dAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13495
2025-05-16"binary" is not valid encoding name in EmacsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/13361
2025-05-09Fix rb_range_beg_len() and rb_arithmetic_sequence_beg_len_step() specBenoit Daloze
* The begp, lenp and stepp might not be written to, so they need default values. Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-05-09Fix digest specs when run in CRuby via make test-specAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-05-09Fix formatting in digest_spec.cAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-05-09Update to ruby/spec@d8bacefAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265
2025-05-08Rename `ivptr` -> `fields`, `next_iv_index` -> `next_field_index`Jean Boussier
Ivars will longer be the only thing stored inline via shapes, so keeping the `iv_index` and `ivptr` names would be confusing. Instance variables won't be the only thing stored inline via shapes, so keeping the `ivptr` name would be confusing. `field` encompass anything that can be stored in a VALUE array. Similarly, `gen_ivtbl` becomes `gen_fields_tbl`. Notes: Merged: https://github.com/ruby/ruby/pull/13159
2025-04-14Expose `ruby_thread_has_gvl_p`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/11975
2025-04-14Add `RUBY_VERSION_IS_3_5`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/11975
2025-04-10Restore the original order of const_added and inherited callbacksXavier Noria
Originally, if a class was defined with the class keyword, the cref had a const_added callback, and the superclass an inherited callback, const_added was called first, and inherited second. This was discussed in https://bugs.ruby-lang.org/issues/21143 and an attempt at changing this order was made. While both constant assignment and inheritance have happened before these callbacks are invoked, it was deemed nice to have the same order as in C = Class.new This was mostly for alignment: In that last use case things happen at different times and therefore the order of execution is kind of obvious, whereas when the class keyword is involved, the order is opaque to the user and it is up to the interpreter. However, soon in https://bugs.ruby-lang.org/issues/21193 Matz decided to play safe and keep the existing order. This reverts commits: de097fbe5f3df105bd2a26e72db06b0f5139bc1a de48e47ddf78aba02fd9623bc7ce685540a10743 Notes: Merged: https://github.com/ruby/ruby/pull/13085
2025-04-02Removed Solaris conditions from optional and shared directoriesHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13037
2025-03-27Update to ruby/spec@5e579e2Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12984
2025-03-20Trigger `inherited` and `const_set` callbacks after const has been definedJean Boussier
[Misc #21143] [Bug #21193] The previous change caused a backward compatibility issue with code that called `Object.const_source_location` from the `inherited` callback. To fix this, the order is now: - Define the constant - Invoke `inherited` - Invoke `const_set` Notes: Merged: https://github.com/ruby/ruby/pull/12956
2025-03-19avoid platform dependent messageYO4
(Bug #21083) https://bugs.ruby-lang.org/issues/21083 Notes: Merged: https://github.com/ruby/ruby/pull/12622
2025-03-14Invoke `inherited` callbacks before `const_added`Jean Boussier
[Misc #21143] Conceptually this makes sense and is more consistent with using the `Name = Class.new(Superclass)` alternative method. However the new class is still named before `inherited` is called. Notes: Merged: https://github.com/ruby/ruby/pull/12927
2025-02-25Prefer `0.000001` over `0.000001f` for timeout calculations. (#12803)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2025-01-30Update to ruby/spec@affef93Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12679
2024-12-10Fix formatting of spec/ruby/optional/capi/ext/hash_spec.cAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
2024-12-10Update to ruby/spec@9f10222Andrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/12297
2024-11-06Update to ruby/spec@54c391eBenoit Daloze
2024-11-04YJIT: Replace Array#each only when YJIT is enabled (#11955)Takashi Kokubun
* YJIT: Replace Array#each only when YJIT is enabled * Add comments about BUILTIN_ATTR_C_TRACE * Make Ruby Array#each available with --yjit as well * Fix all paths that expect a C location * Use method_basic_definition_p to detect patches * Copy a comment about C_TRACE flag to compilers * Rephrase a comment about add_yjit_hook * Give METHOD_ENTRY_BASIC flag to Array#each * Add --yjit-c-builtin option * Allow inconsistent source_location in test-spec * Refactor a check of BUILTIN_ATTR_C_TRACE * Set METHOD_ENTRY_BASIC without touching vm->running Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2024-10-04Update `io_spec.c` to use `rb_io_maybe_wait*` if possible. (#11792)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2024-10-04Better handling of timeout in `rb_io_maybe_wait_*`. (#9531)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2024-10-03Update spec/ruby/ for colon-style hash inspecttompng
Notes: Merged: https://github.com/ruby/ruby/pull/10924
2024-07-24Stop depending on Integer#size to return `sizeof(long)`Alan Wu
There is no guarantee that Integer#size will continue to return `sizeof(long)` for small integers. Use the `l!` specifier for Array#pack instead. It is a public interface that has a direct relationship with the `long` type. Notes: Merged: https://github.com/ruby/ruby/pull/11130
2024-07-24Add "c_long_size" guard, supplanting "wordsize" and stop using Integer#sizeAlan Wu
What a "word" is when talking about sizes is confusing because it's a highly overloaded term. Intel, Microsoft, and GDB are just a few vendors that have their own definition of what a "word" is. Specs that used the "wordsize" guard actually were mostly testing for the size of the C `long` fundamental type, so rename the guard for clarity. Also, get the size of `long` directly from RbConfig instead of guessing using Integer#size. Integer#size is not guaranteed to have anything to do with the `long` type. Notes: Merged: https://github.com/ruby/ruby/pull/11130
2024-07-02Update to ruby/spec@f8987acAndrew Konchin
2024-06-10Update to ruby/spec@517f06fAndrew Konchin
2024-06-07Balance block braces with `#if`Nobuyoshi Nakada
2024-06-07Enclose in ruby_version_is blocksNobuyoshi Nakada
2024-06-07Remove the old untyped Data API in spec/rubyNobuyoshi Nakada
2024-05-19Update to ruby/spec@6b04c1dAndrew Konchin
2024-05-02Declare as NORETURNNobuyoshi Nakada
2024-04-17Revert an accidentally merged change [ci skip]Nobuyoshi Nakada
2024-04-17[Feature #20335] `Thread.each_caller_location` argumentsNobuyoshi Nakada
Accecpt the same arguments as `caller` and `caller_locations`.