| Age | Commit message (Collapse) | Author |
|
[Feature #20901]
Notes:
Merged: https://github.com/ruby/ruby/pull/12115
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12114
|
|
Instead of silently ignoring the key, we should raise to clearly tell
the user that this key is read-only.
Notes:
Merged: https://github.com/ruby/ruby/pull/11872
|
|
This will add +MOD_GC to the version string and Ruby description when
Ruby is compiled with shared gc support.
When shared GC support is compiled in and a GC module has been loaded
using RUBY_GC_LIBRARY, the version string will include the name of
the currently active GC as reported by the rb_gc_active_gc_name function
in the form
+MOD_GC[gc_name]
[Feature #20794]
Notes:
Merged: https://github.com/ruby/ruby/pull/11872
|
|
And a default and readonly key to the GC.config hash that names the
current GC implementation.
This is provided by each implementation by the API function
rb_gc_impl_active_gc_name
Notes:
Merged: https://github.com/ruby/ruby/pull/11872
|
|
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/12074
|
|
As of 10574857ce167869524b97ee862b610928f6272f, it's possible to crash
on a double free due to `stk_alloc` AKA `msa->stack_p` being freed
twice, once at the end of match_at and a second time in `FREE_MATCH_ARG`
in the parent caller.
Fixes [Bug #20886]
Notes:
Merged: https://github.com/ruby/ruby/pull/12030
|
|
This test was relying on a sleep to synchronise the parent and child
processes. By having the child be the process that stops itself with
SIGSTOP, instead of the parent, we can actually properly wait for that
using waitpid2 and be notified of the stop.
This use of sleep to synchronise processes is potentially flaky and
caused failures under rr's `--chaos` mode.
Notes:
Merged: https://github.com/ruby/ruby/pull/12042
|
|
Although a binary (aka ASCII-8BIT) string will never have a broken
coderange, it still has to differentiate between "valid" and "7bit".
On Ruby 3.4/trunk this problem is masked because we now clear the
coderange more agressively in rb_str_resize, and we happened to always
be strinking this string, but we should not assume that.
On Ruby 3.3 this created strings where `ascii_only?` was true in cases
it shouldn't be as well as other problems.
Fixes [Bug #20883]
Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Co-authored-by: Matthew Draper <matthew@trebex.net>
Notes:
Merged: https://github.com/ruby/ruby/pull/12029
|
|
If there's a syntax error during iseq compilation then prism would leak
memory because it would not free the pm_parse_result_t.
This commit changes pm_iseq_new_with_opt to have a rb_protect to catch
when an error is raised, and return NULL and set error_state to a value
that can be raised by calling rb_jump_tag after memory has been freed.
For example:
10.times do
10_000.times do
eval("/[/=~s")
rescue SyntaxError
end
puts `ps -o rss= -p #{$$}`
end
Before:
39280
68736
99232
128864
158896
188208
217344
246304
275376
304592
After:
12192
13200
14256
14848
16000
16000
16000
16064
17232
17952
Notes:
Merged: https://github.com/ruby/ruby/pull/12036
|
|
... for slow CI machines like macOS.
|
|
... instead, just calculate the value unless it is too big.
Also, this change raises an ArgumentError if it is expected to exceed
16 GB in a 64-bit environment.
(It is possible to calculate it straightforward, but it would likely be
out-of-memory, so I didn't think it would make sense.)
[Feature #20811]
Notes:
Merged: https://github.com/ruby/ruby/pull/12033
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12023
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12022
|
|
|
|
#set_string (#11640)
The current implementation of `IO::Buffer#copy` and `#set_string` has
an undefined behavior when the source and destination memory overlaps,
due to the underlying use of the `memcpy` C function.
This patch guarantees the methods to be safe even when copying between
overlapping buffers by replacing `memcpy` with `memmove`,
Fixes: [Bug #20745]
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
The hash value of a Method must remain constant after a compaction, otherwise
it may not work as the key in a hash table.
For example:
def a; end
# Need this method here because otherwise the iseq may be on the C stack
# which would get pinned and not move during compaction
def get_hash
method(:a).hash
end
puts get_hash # => 2993401401091578131
GC.verify_compaction_references(expand_heap: true, toward: :empty)
puts get_hash # => -2162775864511574135
Notes:
Merged: https://github.com/ruby/ruby/pull/12004
|
|
I caught a reproduction of this test failing under rr, and was able to
replay it to isolate the failure. The call to
`before_stat_heap = GC.stat_heap` is itself allocating a hash, which in
unlucky circumstances can result in a new page being allocated and thus
`before_stats[:heap_allocated_pages]` no longer equals
`after_stats[:heap_allocated_pages]`.
The solution is to use the form of GC.stat/stat_heap which takes a hash
as an argument, and thus needs to perform no Ruby allocations itself.
Notes:
Merged: https://github.com/ruby/ruby/pull/11997
|
|
|
|
`-FIXNUM_MIN` is usually greater than `FIXNUM_MAX` on platforms using
two's complement representation.
Notes:
Merged: https://github.com/ruby/ruby/pull/12011
|
|
to show unused block warning strictly.
```ruby
class C
def f = nil
end
class D
def f = yield
end
[C.new, D.new].each{|obj| obj.f{}}
```
In this case, `D#f` accepts a block. However `C#f` doesn't
accept a block. There are some cases passing a block with
`obj.f{}` where `obj` is `C` or `D`. To avoid warnings on
such cases, "unused block warning" will be warned only if
there is not same name which accepts a block.
On the above example, `C.new.f{}` doesn't show any warnings
because there is a same name `D#f` which accepts a block.
We call this default behavior as "relax mode".
`strict_unused_block` new warning category changes from
"relax mode" to "strict mode", we don't check same name
methods and `C.new.f{}` will be warned.
[Feature #15554]
Notes:
Merged: https://github.com/ruby/ruby/pull/12005
|
|
* 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>
|
|
The temporary directory is the second argument.
|
|
not supported
Notes:
Merged: https://github.com/ruby/ruby/pull/11980
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
The hash value of a Proc must remain constant after a compaction, otherwise
it may not work as the key in a hash table.
Notes:
Merged: https://github.com/ruby/ruby/pull/11966
|
|
`me->defined_class` should be 0 for method entries of
Modules.
This patch checks this condition
and fix https://github.com/ruby/ruby/pull/11965#issuecomment-2448291790
Notes:
Merged: https://github.com/ruby/ruby/pull/11968
|
|
The following code crashes with assertions enabled because envval could
be Qundef:
{}.to_proc.dup
Notes:
Merged: https://github.com/ruby/ruby/pull/11970
|
|
|
|
[Feature #20205]
The warning now suggests running with --debug-frozen-string-literal:
```
test.rb:3: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information)
```
When using --debug-frozen-string-literal, the location where the string
was created is shown:
```
test.rb:3: warning: literal string will be frozen in the future
test.rb:1: info: the string was created here
```
When resurrecting strings and debug mode is not enabled, the overhead is a simple FL_TEST_RAW.
When mutating chilled strings and deprecation warnings are not enabled,
the overhead is a simple warning category enabled check.
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/11893
|
|
If there is a syntax error, there could be an ast_node in the result.
This could get leaked if there is a syntax error so parsing could not
complete (parsed is not set to true).
For example, the following script leaks memory:
10.times do
10_000.times do
eval("def foo(...) super(...) {}; end")
rescue SyntaxError
end
puts `ps -o rss= -p #{$$}`
end
Before:
31328
42768
53856
65120
76208
86768
97856
109120
120208
131296
After:
20944
20944
20944
20944
20944
20944
20944
20944
20944
20944
Notes:
Merged: https://github.com/ruby/ruby/pull/11901
|
|
This would be useful for debugging.
Notes:
Merged: https://github.com/ruby/ruby/pull/11896
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11905
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11883
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11892
|
|
It's testing whether GC compaction is supported in general.
Notes:
Merged: https://github.com/ruby/ruby/pull/11885
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11885
|
|
GC.config is always defined.
Notes:
Merged: https://github.com/ruby/ruby/pull/11867
|
|
|
|
beta, we should skip with macOS 15.0"
This reverts commit 3830bca5edd6964131971866c80107c89fac5362.
Notes:
Merged: https://github.com/ruby/ruby/pull/11849
|
|
```
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
-:3: warning: assigned but unused variable - var
```
|
|
This commit ensures warnings about `object_id` and `__send__` method
redefinitions are emitted for other method types such as aliases, procs,
and attr readers—anything except C functions.
|
|
https://bugs.ruby-lang.org/issues/20789
Notes:
Merged: https://github.com/ruby/ruby/pull/11850
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11811
|
|
The absence of either the integer or fractional part should be
allowed.
Notes:
Merged: https://github.com/ruby/ruby/pull/11807
|
|
Co-authored-by: Adam Hess <HParker@github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/11800
|
|
Now that we've inlined the eden_heap into the size_pool, we should
rename the size_pool to heap. So that Ruby contains multiple heaps, with
different sized objects.
The term heap as a collection of memory pages is more in memory
management nomenclature, whereas size_pool was a name chosen out of
necessity during the development of the Variable Width Allocation
features of Ruby.
The concept of size pools was introduced in order to facilitate
different sized objects (other than the default 40 bytes). They wrapped
the eden heap and the tomb heap, and some related state, and provided a
reasonably simple way of duplicating all related concerns, to provide
multiple pools that all shared the same structure but held different
objects.
Since then various changes have happend in Ruby's memory layout:
* The concept of tomb heaps has been replaced by a global free pages list,
with each page having it's slot size reconfigured at the point when it
is resurrected
* the eden heap has been inlined into the size pool itself, so that now
the size pool directly controls the free_pages list, the sweeping
page, the compaction cursor and the other state that was previously
being managed by the eden heap.
Now that there is no need for a heap wrapper, we should refer to the
collection of pages containing Ruby objects as a heap again rather than
a size pool
Notes:
Merged: https://github.com/ruby/ruby/pull/11771
|
|
prepended to singleton class
To simplify the implementation, this makes Object#singleton_method
call the same method called by Object#method (rb_obj_method), then
check that the returned Method is defined before the superclass of the
object's singleton class. To keep the same error messages, it rescues
exceptions raised by rb_obj_method, and then raises its own exception.
Fixes [Bug #20620]
Notes:
Merged: https://github.com/ruby/ruby/pull/11605
|