| Age | Commit message (Collapse) | Author |
|
And get rid of the `obj_to_id_tbl`
It's no longer needed, the `object_id` is now stored inline
in the object alongside instance variables.
We still need the inverse table in case `_id2ref` is invoked, but
we lazily build it by walking the heap if that happens.
The `object_id` concern is also no longer a GC implementation
concern, but a generic implementation.
Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/13159
|
|
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
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13256
|
|
This halves the amount of memory used for embedded RTypedData if they
are one VALUE (8 bytes on 64-bit platforms) over the slot size limit.
For Set, on 64-bit it uses an embedded 56-byte struct. With the
previous implementation, the embedded structs starts at offset 32,
resulting in a total size of 88. Since that is over the 80 byte
limit, it goes to the next highest bucket, 160 bytes, wasting 72
bytes. This allows it to fit in a 80 byte bucket, which reduces
the total size for small sets of from 224 bytes (160 bytes
embedded, 64 bytes malloc, 72 bytes wasted in embedding) to 144
bytes (80 bytes embedded, 64 bytes malloc, 0 bytes wasted in
embedding).
Any other embedded RTypedData will see similar advantages if they
are currently one VALUE over the limit.
To implement this, remove the typed_flag from struct RTypedData.
Embed the typed_flag information in the type member, which is
now a tagged pointer using VALUE type, using the bottom low 2 bits
as flags (1 bit for typed flag, the other for the embedded flag).
To get the actual pointer, RTYPEDDATA_TYPE masks out
the low 2 bits and then casts. That moves the RTypedData data
pointer from offset 32 to offset 24 (on 64-bit).
Vast amount of code in the internals (and probably external C
extensions) expects the following code to work for both RData and
non-embedded RTypedData:
```c
DATA_PTR(obj) = some_pointer;
```
Allow this to work by moving the data pointer in RData between
the dmark and dfree pointers, so it is at the same offset (24
on 64-bit).
Other than these changes to the include files, the only changes
needed were to gc.c, to account for the new struct layouts,
handle setting the low bits in the type member, and to use
RTYPEDDATA_TYPE(obj) instead of RTYPEDDATA(obj)->type.
Notes:
Merged: https://github.com/ruby/ruby/pull/13190
|
|
If the shape has only one child, we check it lock-free without
compromising thread safety.
I haven't computed hard data as to how often that it the case,
but we can assume that it's not too rare for shapes to have
a single child that is often requested, typically when freezing
and object.
Notes:
Merged: https://github.com/ruby/ruby/pull/13191
|
|
|
|
Fixes [Bug #21286]
Notes:
Merged: https://github.com/ruby/ruby/pull/13202
|
|
[ci skip]
Notes:
Merged: https://github.com/ruby/ruby/pull/13207
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12921
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11975
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12553
|
|
This allows C-Extension developers to call those methods to retrieve
information about a TracePoint's parameters, eval script and
instruction sequence.
Implements [Feature #20757]
Notes:
Merged: https://github.com/ruby/ruby/pull/12553
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12933
|
|
The content depends on ruby internal, not responsibility of the
caller. Revive `RUBY_GLOBAL_SETUP` macro to define the hook function.
Notes:
Merged: https://github.com/ruby/ruby/pull/12933
|
|
RUBY_CONST_ID has never been deprecated; `rb_intern` is handy but it
is using non-standard GCC extensions and does not cache the ID with
other compilers.
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12739
|
|
And finally deprecated at C++-17.
Patched by jprokop (Jarek Prokop).
Notes:
Merged: https://github.com/ruby/ruby/pull/12573
|
|
|
|
Although this function is unrelated to hash, it was defined in hash.c
to check PATH environment variable originally. Then the definition
was moeved to file.c but the declaration was left in the hash.c block.
Notes:
Merged: https://github.com/ruby/ruby/pull/12564
|
|
c.f. #20971
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12551
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12459
|
|
|
|
The macro MAYBE_UNUSED, prepared by ./configure, may not be defined in
some environments such as Oracle Developer Studio 12.5 on Solaris 10.
This fixes [Bug #20963]
|
|
Thanks, nobu!
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12376
|
|
`_umul128` is specific to x86_64 platform, see higher words by
`__umulh` on arm64.
Notes:
Merged: https://github.com/ruby/ruby/pull/12367
|
|
It is not "in bytes" for wide char literal.
|
|
|
|
Explaining this by reference to rb_id2str() obscures a few important
details because IDs and symbols don't map to each other perfectly (you
can have a dynamic symbol without an ID!) Also, it used to take 2
redirections to get to concrete information, and I think being more
direct is friendlier.
|
|
|
|
Redirect `rb_nogvl` blocking operations to the fiber scheduler if possible
to prevent stalling the event loop.
[Feature #20876]
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
* Use FL_USER0 for ELTS_SHARED
This makes space in RString for two bits for chilled strings.
* Mark strings returned by `Symbol#to_s` as chilled
[Feature #20350]
`STR_CHILLED` now spans on two user flags. If one bit is set it
marks a chilled string literal, if it's the other it marks a
`Symbol#to_s` chilled string.
Since it's not possible, and doesn't make much sense to include
debug info when `--debug-frozen-string-literal` is set, we can't
include allocation source, but we can safely include the symbol
name in the warning message, making it much easier to find the source
of the issue.
Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com>
---------
Co-authored-by: Étienne Barrié <etienne.barrie@gmail.com>
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12060
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12046
|
|
If `long` and `int` are the same size, `unsigned int` max would exceed
`signed long` range. It is guaranteed by `RB_POSFIXABLE` that `v` can
be casted to `long` safely here.
Notes:
Merged: https://github.com/ruby/ruby/pull/12045
|
|
This reverts some of commit 87fb44dff6409a19d12052cf0fc07ba80a4c45ac.
We will rename and propose a slightly different interface.
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
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
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/11985
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
gcc 14 for aarch64 with `-O3` may emit a false positive warning for a
pointer access of `RB_BUILTIN_TYPE` called from `RB_TYPE_P`. `Qfalse`
shouldn't get there because of `RB_SPECIAL_CONST_P`, but the optimizer
seems to ignore this condition in some cases (`ASSUME` just before the
access doesn't seem to have any effect either). Only by reversing the
order in `RB_SPECIAL_CONST_P` to compare with 0 first does the warning
seem to go away.
Notes:
Merged: https://github.com/ruby/ruby/pull/11928
|
|
- ISO C forbids conversion of function pointer to object pointer type
- ISO C forbids conversion of object pointer to function pointer type
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
## Why?
The explanation of x and y is reversed.
https://github.com/ruby/ruby/blob/ddbd64400199fd408d23c85f9fb0d7f742ecf9e1/re.c#L251-L256
```
long
rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
{
const unsigned char *x = x0, *y = y0;
if (m > n) return -1;
```
Notes:
Merged: https://github.com/ruby/ruby/pull/11625
|
|
|
|
```
../../.././include/ruby/internal/special_consts.h:349:36: error: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Werror=sign-conversion]
349 | return RB_SPECIAL_CONST_P(obj) * RUBY_Qtrue;
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
```
|
|
[Bug #20650]
The capture group allocates memory that is leaked when it times out.
For example:
re = Regexp.new("^#{"(a*)" * 10_000}x$", timeout: 0.000001)
str = "a" * 1000000 + "x"
10.times do
100.times do
re =~ str
rescue Regexp::TimeoutError
end
puts `ps -o rss= -p #{$$}`
end
Before:
34688
56416
78288
100368
120784
140704
161904
183568
204320
224800
After:
16288
16288
16880
16896
16912
16928
16944
17184
17184
17200
Notes:
Merged: https://github.com/ruby/ruby/pull/11238
|