ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [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.
@ 2022-05-13 13:54 byroot (Jean Boussier)
  2022-05-20 17:07 ` [ruby-core:108640] " mdalessio (Mike Dalessio)
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: byroot (Jean Boussier) @ 2022-05-13 13:54 UTC (permalink / raw)
  To: ruby-core

Issue #18779 has been reported by byroot (Jean Boussier).

----------------------------------------
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

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-25  1:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ruby-core:108742] " jaruga (Jun Aruga)
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

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).