ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "jaruga (Jun Aruga)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:108742] [Ruby master Bug#18779] `GC.compact` and other compaction related methods should be defined as rb_f_notimplement on non supported platforms.
Date: Tue, 31 May 2022 09:59:24 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-97802.20220531095923.7941@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-18779.20220513135435.7941@ruby-lang.org

Issue #18779 has been updated by jaruga (Jun Aruga).


> I'm marking 3.0 and 3.1 for backport. The two commits are:
> 
>    6ddec1082d06431111123c03b18ca41e7a2cec12
>    e9623f7432b4603735c74b6f0bb683a9bf19c2c6

Did you backport to ruby_3_0 and ruby_3_1 branches? I cannot find the 2 commit hashes above.


----------------------------------------
Bug #18779: `GC.compact` and other compaction related methods should be defined as rb_f_notimplement on non supported platforms. 
https://bugs.ruby-lang.org/issues/18779#change-97802

* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
* Backport: 2.7: WONTFIX, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
I received several bug report on native gems using `GC.verify_compaction_references` in their test suite.

Examples:

  - https://github.com/msgpack/msgpack-ruby/pull/275/files
  - https://github.com/Shopify/bootsnap/pull/414/files

I think that when `!GC_COMPACTION_SUPPORTED`, rather than raise `NotImplementedError`, we should instead define these methods as `rb_f_notimplement` like `Process.fork` on Windows.

This way `GC.respond_to?(:compact)` would be a proper way to test for compaction support.

Unfortunately, these methods are defined through `.rb` files with `Primitive`, and I don't know wether it's possible to check `GC_COMPACTION_SUPPORTED` from there, nor if it's possible to define a `rb_f_notimplement` method.

cc @tenderlovemaking 



-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2022-05-31  9:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 13:54 [ruby-core:108543] [Ruby master Bug#18779] `GC.compact` and other compaction related methods should be defined as rb_f_notimplement on non supported platforms byroot (Jean Boussier)
2022-05-20 17:07 ` [ruby-core:108640] " mdalessio (Mike Dalessio)
2022-05-23 22:54 ` [ruby-core:108658] " mdalessio (Mike Dalessio)
2022-05-24 17:05 ` [ruby-core:108667] " byroot (Jean Boussier)
2022-05-31  9:59 ` jaruga (Jun Aruga) [this message]
2022-05-31 10:01 ` [ruby-core:108743] " byroot (Jean Boussier)
2022-05-31 10:26 ` [ruby-core:108744] " jaruga (Jun Aruga)
2022-05-31 10:30 ` [ruby-core:108745] " byroot (Jean Boussier)
2022-11-30 13:39 ` [ruby-core:111089] " vo.x (Vit Ondruch)
2023-03-25  1:56 ` [ruby-core:113006] " nagachika (Tomoyuki Chikanaga) via ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-97802.20220531095923.7941@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).