Commit Graph
377 Commits
Author SHA1 Message Date
Nobuyoshi Nakada ac135260de Fix unused-but-set-global warnings in clang-23 2026-06-25 15:40:27 +09:00
Jean Boussier e4667e5109 Refactor NEWOB_OF for the common protected use case
Almost every objects are now WB protected, with just a few
exceptions, hence we can provide a much simpler interface.

It's also much easier to find the remaining unprotected objects.
2026-04-28 11:11:29 +09:00
Jean Boussier c202bc08e1 Simplify NEWOBJ_OF and introduce EC_NEWOBJ_OF
We only very rarely have the execution context available, so
it's preferable to provide a simpler default macro.
2026-04-28 11:11:29 +09:00
Jean Boussier 5e99295f1e Get rid of RGENGC_WB_PROTECTED_COMPLEX
It has been the default for a very long time and there is no good reason to
disable it.
2026-04-28 09:39:07 +09:00
Nobuyoshi Nakada f70f8338e3 Direct calls for specific numeric types in complex/rational 2026-02-18 11:12:29 +09:00
Jean BoussierandBenoit Daloze d066b9e01c Refactor type error to be more consistent
[Bug #21864]

Co-Authored-By:  Benoit Daloze <eregontp@gmail.com>
2026-02-07 10:06:36 +01:00
BurdetteLamar ed0a5c6f0f [DOC] Fix links in Complex 2026-01-26 17:04:58 -05:00
tomoya ishida b536c6a849 [DOC] Remove _emphasis_ in code blocks which is not handled as emphasis anymore (#15901) 2026-01-19 04:59:09 +09:00
Burdette Lamar 58fb95af36 [DOC] Harmonize #== methods (#15805) 2026-01-06 17:13:15 -05:00
Nobuyoshi Nakada a41b154029 Remove rb_complex_polar deprecated for 7 years 2025-12-26 17:02:42 +09:00
BurdetteLamar 5808727851 [DOC] Fix indentation error in Complex#<=> 2025-12-20 18:13:17 -05:00
BurdetteLamar b7d4d7c911 [DOC] Harmonize several <=> methods 2025-12-19 21:36:46 -05:00
BurdetteLamar 2d01406644 [DOC] Harmonize rb_div methods 2025-12-16 17:47:08 -05:00
BurdetteLamar cfd41cbf03 [DOC] Harmonize #-@ methods 2025-12-15 17:28:35 -05:00
BurdetteLamar acbf55f4e6 [DOC] Harmonize #- methods 2025-12-15 17:27:54 -05:00
BurdetteLamar 7fbf321d23 [DOC] Harmonize #** methods 2025-12-15 17:27:24 -05:00
Burdette Lamar b2f110651c [DOC] Harmonize #+ methods 2025-12-02 21:39:25 -05:00
BurdetteLamar b47b37c12c [DOC] Harmonize #* methods 2025-11-21 14:11:54 -08:00
Burdette Lamar 75d25a42e6 [DOC] Tweaks for String#to_c 2025-11-08 10:08:09 -05:00
Hartley McGuire 8120971932 Move more NilClass methods to ruby
```
$ make benchmark ITEM=nilclass COMPARE_RUBY="/opt/rubies/ruby-master/bin/ruby"
/opt/rubies/3.4.2/bin/ruby --disable=gems -rrubygems -I../benchmark/lib ../benchmark/benchmark-driver/exe/benchmark-driver \
                    --executables="compare-ruby::/opt/rubies/ruby-master/bin/ruby -I.ext/common --disable-gem" \
                    --executables="built-ruby::./miniruby -I../lib -I. -I.ext/common  ../tool/runruby.rb --extout=.ext  -- --disable-gems --disable-gem" \
                    --output=markdown --output-compare -v $(find ../benchmark -maxdepth 1 -name 'nilclass' -o -name '*nilclass*.yml' -o -name '*nilclass*.rb' | sort)
compare-ruby: ruby 3.5.0dev (2025-06-02T13:52:25Z master cbd49ecbbe) +PRISM [arm64-darwin24]
built-ruby: ruby 3.5.0dev (2025-06-02T22:47:21Z hm-ruby-nilclass 3e7f1f0466) +PRISM [arm64-darwin24]

|             |compare-ruby|built-ruby|
|:------------|-----------:|---------:|
|rationalize  |     24.056M|   53.908M|
|             |           -|     2.24x|
|to_c         |     23.652M|   82.781M|
|             |           -|     3.50x|
|to_i         |     89.526M|   84.388M|
|             |       1.06x|         -|
|to_f         |     84.746M|   96.899M|
|             |           -|     1.14x|
|to_r         |     25.107M|   83.472M|
|             |           -|     3.32x|
|splat        |     42.772M|   42.717M|
|             |       1.00x|         -|
```

This makes them much faster
2025-06-12 09:30:09 +02:00
Nobuyoshi Nakada c218862d3c Fix style [ci skip] 2025-04-19 22:02:10 +09:00
Nobuyoshi Nakada e433e6515e [DOC] Exclude 'Class' and 'Module' from RDoc's autolinking 2025-01-02 12:36:06 +09:00
Nobuyoshi Nakada b4ec22fe6c [DOC] Exclude 'Method' from RDoc's autolinking 2025-01-02 12:23:49 +09:00
Stan Lo 730731cc86 Fix links to syntax/literals.rdoc 2024-12-15 15:36:08 +09:00
Jean Boussier 8c7e291dd8 Update references to flori/json
Now that the repository was transfered, these links will become
dead in a few months.
2024-10-07 20:12:57 -04:00
Jeremy Evans 9f574fa12f Make Complex#{inspect,to_s} work correctly if real part #inspect returns frozen string
Make static f_format function take a non-frozen string to append
to.

This does not result in an additional allocation for #inspect,
but it does result in an additional allocation for #to_s.

Fixes [Bug #20337]
2024-09-21 20:00:23 +02:00
BurdetteLamar ac85eef18b Fix links 2024-05-18 15:44:24 +09:00
Jean Boussier f06670c5a2 Eliminate usage of OBJ_FREEZE_RAW
Previously it would bypass the `FL_ABLE` check, but
since shapes introduction, it started having a different
behavior than `OBJ_FREEZE`, as it would onyl set the `FL_FREEZE`
flag, but not update the shape.

I have no indication of this causing a bug yet, but it seems
like a trap waiting to happen.
2024-04-16 17:20:35 +02:00
Jean Boussier d4f3dcf4df Refactor VM root modules
This `st_table` is used to both mark and pin classes
defined from the C API. But `vm->mark_object_ary` already
does both much more efficiently.

Currently a Ruby process starts with 252 rooted classes,
which uses `7224B` in an `st_table` or `2016B` in an `RArray`.

So a baseline of 5kB saved, but since `mark_object_ary` is
preallocated with `1024` slots but only use `405` of them,
it's a net `7kB` save.

`vm->mark_object_ary` is also being refactored.

Prior to this changes, `mark_object_ary` was a regular `RArray`, but
since this allows for references to be moved, it was marked a second
time from `rb_vm_mark()` to pin these objects.

This has the detrimental effect of marking these references on every
minors even though it's a mostly append only list.

But using a custom TypedData we can save from having to mark
all the references on minor GC runs.

Addtionally, immediate values are now ignored and not appended
to `vm->mark_object_ary` as it's just wasted space.
2024-03-06 15:33:43 -05:00
Kenta Murata 54a5b82944 Handle zero-like imaginary part as zero in to_r (#9581)
Fixes [Bug #5179]
2024-02-27 09:37:03 +09:00
Nobuyoshi Nakada dc146babf4 [Bug #20296] Clear errinfo when exception: false 2024-02-26 11:56:38 +09:00
Takashi Kokubun 38bf622cdc Fix -Wmaybe-uninitialized on Complex#** (#10075) 2024-02-22 23:28:46 +00:00
Peter Zhu 7256e38f86 Replace assert with RUBY_ASSERT in complex.c
assert does not print the bug report, only the file and line number of
the assertion that failed. RUBY_ASSERT prints the full bug report, which
makes it much easier to debug.
2024-02-12 15:07:47 -05:00
Nobuyoshi Nakada 361b3efe16 Use UNDEF_P 2024-01-30 14:48:59 +09:00
Burdette Lamar 0990270c38 [DOC] Add What's Here for Complex (#9366) 2023-12-28 09:33:06 -05:00
BurdetteLamar 17e1d8ca62 RDoc for Complex 2023-12-26 11:27:31 -05:00
BurdetteLamar 901359559b RDoc for complex.c 2023-12-25 22:07:44 -05:00
BurdetteLamar 86ef38194b RDoc for complex.c 2023-12-24 14:56:06 -05:00
BurdetteLamar 8ad8803bb4 RDoc for Complex 2023-12-24 11:00:30 -05:00
Burdette Lamar 9b289d58f7 [DOC] RDoc for Complex (#9307) 2023-12-22 22:31:18 -05:00
BurdetteLamar f0b86f8c60 RDoc for Complex 2023-12-19 17:29:09 -05:00
BurdetteLamar 084b44e79d RDoc for Complex 2023-12-19 14:30:33 -05:00
Burdette Lamar f907a7111c [DOC] RDoc for Complex (#9260) 2023-12-18 21:40:58 -05:00
Burdette Lamar 655c02790e [DOC] RDoc for Complex (#9254) 2023-12-15 13:32:32 -05:00
Burdette Lamar 10a0545b6e [DOC] RDoc for Complex (#9243) 2023-12-15 09:39:12 -05:00
Burdette Lamar 247ce712fc [DOC] RDoc for Complex (#9231) 2023-12-14 11:09:17 -05:00
BurdetteLamar 18a5b6b7e9 [DOC] RDoc for Complex 2023-12-12 17:32:59 -05:00
Burdette Lamar e1d995a96c [DOC] Complex doc (#9185) 2023-12-11 15:38:16 -05:00
Nobuyoshi Nakada 655aacc43a Use dedicated functions to check terminators 2023-12-11 16:51:46 +09:00
Burdette Lamar 91b0d5fa38 [DOC] RDoc for Complex (#9181) 2023-12-10 10:22:22 -05:00