Age | Commit message (Collapse) | Author |
|
Include stdbool.h without checking with autoconf
As reported in <https://bugs.ruby-lang.org/issues/21340>, older autoconf
have an AC_HEADER_STDBOOL that's incompatible with C23. Autoconf 2.72
fixed the macro, but also mentions that it's obsolescent since all
current compilers have this header.
Since we require C99 [1] and VS 2015 [2], we might actually be able take
that suggestion and include stdbool.h without a check. I want to try
this on rubyci.org and will revert if this cause any issues. Not
touching AC_HEADER_STDBOOL in configure.ac for now.
[1]: https://bugs.ruby-lang.org/issues/15347
[2]: https://bugs.ruby-lang.org/issues/19982
|
|
Fix C23 (GCC 15) WIN32 compatibility for rb_define_* functions
Fixes [Bug #21286]
|
|
|
|
#20005]
This is a C API for extensions to resolve and get function symbols of other extensions.
Extensions can check the expected symbol is correctly loaded and accessible, and
use it if it is available.
Otherwise, extensions can raise their own error to guide users to setup their
environments correctly and what's missing.
|
|
Instead of `RUBY_REFERENCES_START` and `RUBY_REFERENCES_END`, so that
auto-indent works well.
|
|
Also move `struct` so that `typedef`-ed names can be used.
|
|
|
|
Fixes:
```
/usr/local/ruby/include/ruby-3.3.0+0/ruby/internal/core/rtypeddata.h:467:33:
error: invalid conversion from ‘void*’ to ‘parser_t*’ [-fpermissive]
467 | (sval) = RTYPEDDATA_GET_DATA(result); \
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~
| |
| void*
```
|
|
This commit adds a new flag RUBY_TYPED_EMBEDDABLE that allows the data
of a TypedData object to be embedded after the object itself. This will
improve cache locality and allow us to save the 8 byte data pointer.
Co-Authored-By: Jean Boussier <[email protected]>
|
|
* rb_warn() does not warn if $VERBOSE is nil, the "always" is wrong.
* Talk about $VERBOSE and not -W since $VERBOSE can be changed at runtime.
|
|
|
|
|
|
Notes:
Merged-By: ioquatix <[email protected]>
|
|
cf: https://github.com/llvm/llvm-project/commit/874217f99b99ab3c9026dc3b7bd84cd2beebde6e
Notes:
Merged: https://github.com/ruby/ruby/pull/8274
|
|
Notes:
Merged-By: maximecb <[email protected]>
|
|
fix [Feature #19572]
Notes:
Merged: https://github.com/ruby/ruby/pull/8150
|
|
Since edf01d4e82d8e44ee30ec41fbcb7f802bc8b8c5d, fake string treats
NULL as an empty string.
|
|
|
|
|
|
RARRAY_CONST_PTR now does the same things as RARRAY_CONST_PTR_TRANSIENT.
Notes:
Merged: https://github.com/ruby/ruby/pull/8071
|
|
RARRAY_PTR_USE now does the same things as RARRAY_PTR_USE_TRANSIENT.
Notes:
Merged: https://github.com/ruby/ruby/pull/8071
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8071
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7942
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/8066
|
|
Closes [Feature #19729]
Previously 2 bits of the flags on each RVALUE are reserved to store the
number of GC cycles that each object has survived. This commit
introduces a new bit array on the heap page, called age_bits, to store
that information instead.
This patch still reserves one of the age bits in the flags (the old
FL_PROMOTED0 bit, now renamed FL_PROMOTED).
This is set to 0 for young objects and 1 for old objects, and is used as
a performance optimisation for the write barrier. Fetching the age_bits
from the heap page and doing the required math to calculate if the
object was old or not would slow down the write barrier. So we keep this
bit synced in the flags for fast access.
Notes:
Merged: https://github.com/ruby/ruby/pull/7938
|
|
This compile time flag was removed in https://github.com/ruby/ruby/pull/7313
This commit cleans up some related dead code.
Notes:
Merged: https://github.com/ruby/ruby/pull/7982
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7983
|
|
* Make TAINT and UNTRUSTED flags zero
These flags do nothing already, and should break nothing.
* Remove TAINT and UNTRUSTED macros same as functions
These macros had been defined to use with `#ifdef`, but should not be
used anymore.
Notes:
Merged-By: maximecb <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7945
|
|
Since no type information is available for variadic arguments, 0 is
passed as `int` without promoting to pointer. On platforms where
`sizeof(int) < sizeof(void*)`, the terminator argument may be read
together with an adjoining word, and may not be found.
|
|
* Unify length field for embedded and heap strings
The length field is of the same type and position in RString for both
embedded and heap allocated strings, so we can unify it.
* Remove RSTRING_EMBED_LEN
Notes:
Merged-By: maximecb <[email protected]>
|
|
POSIX reserves `_t` suffix in types.
Notes:
Merged-By: ioquatix <[email protected]>
|
|
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2.
fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
|
|
* Add rb_io_path and rb_io_open_descriptor.
* Use rb_io_open_descriptor to create PTY objects
* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it
FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.
* Ensure that rb_io_open_descriptor closes the FD if it fails
If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.
* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P
* Expose `rb_io_closed_p`.
* Add `rb_io_mode` to get IO mode.
---------
Co-authored-by: KJ Tsanaktsidis <[email protected]>
Notes:
Merged-By: ioquatix <[email protected]>
|
|
These must not be changed once initialized.
|
|
Followup: ac123f167a364c3d7a43eca78d564e41f6dbb91e
RB_WARN_CATEGORY_ALL_BITS is exposed in a public header, so it
makes sense for it to be updated to contain all valid bits.
Instead we introduce RB_WARN_CATEGORY_DEFAULT_BITS to list the
categories that are enabled by default.
Notes:
Merged: https://github.com/ruby/ruby/pull/7710
|
|
[Feature #19538]
This new `peformance` warning category is disabled by default.
It needs to be specifically enabled via `-W:performance` or `Warning[:performance] = true`
Notes:
Merged: https://github.com/ruby/ruby/pull/7708
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7706
|
|
|
|
Remove !USE_RVARGC code
[Feature #19579]
The Variable Width Allocation feature was turned on by default in Ruby
3.2. Since then, we haven't received bug reports or backports to the
non-Variable Width Allocation code paths, so we assume that nobody is
using it. We also don't plan on maintaining the non-Variable Width
Allocation code, so we are going to remove it.
Notes:
Merged-By: maximecb <[email protected]>
|
|
When using rb_data_type_struct to wrap a C struct, that C struct can
contain VALUE references to other Ruby objects.
If this is the case then one must also define dmark and optionally
dcompact callbacks in order to allow these objects to be correctly
handled by the GC. This is suboptimal as it requires GC related logic to
be implemented by extension developers. This can be a cause of subtle
bugs when references are not marked of updated correctly inside these
callbacks.
This commit provides an alternative approach, useful in the simple case
where the C struct contains VALUE members (ie. there isn't any
conditional logic, or data structure manipulation required to traverse
these references).
In this case references can be defined using a declarative syntax
as a list of edges (or, pointers to references).
A flag can be set on the rb_data_type_struct to notify the GC that
declarative references are being used, and a list of those references
can be assigned to the dmark pointer instead of a function callback, on
the rb_data_type_struct.
Macros are also provided for simple declaration of the reference list,
and building edges.
To avoid having to also find space in the struct to define a length for
the references list, I've chosed to always terminate the references list
with RUBY_REF_END - defined as UINTPTR_MAX. My assumption is that no
single struct will ever be large enough that UINTPTR_MAX is actually a
valid reference.
Notes:
Merged: https://github.com/ruby/ruby/pull/7153
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7461
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7461
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7459
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7310
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7310
|
|
These warnings are displayed when compiling with flag "-Wunused-parameter" (or
with "-Wall -Wextra").
Notes:
Merged: https://github.com/ruby/ruby/pull/7085
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7330
|
|
This macro is broken when set to anything other than 0. And has had a
comment saying that it's broken for 3 years.
This commit deletes it and the associated logging code. It's clearly
not being used.
Co-Authored-By: Peter Zhu <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/7312
|
|
They only have two references.
Notes:
Merged: https://github.com/ruby/ruby/pull/7286
|