From f48e45d1e9c4412d5f3ee49241d0b9359651ce7c Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 21 Apr 2025 16:16:07 +0900 Subject: Move `object_id` in object fields. 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 --- include/ruby/internal/fl_type.h | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'include/ruby') diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h index f80f65ef8f..0cad5b673d 100644 --- a/include/ruby/internal/fl_type.h +++ b/include/ruby/internal/fl_type.h @@ -280,24 +280,12 @@ ruby_fl_type { = 0, - /** - * This flag has something to do with object IDs. Unlike in the old days, - * an object's object ID (that a user can query using `Object#object_id`) - * is no longer its physical address represented using Ruby level integers. - * It is now a monotonic-increasing integer unrelated to the underlying - * memory arrangement. Object IDs are assigned when necessary; objects are - * born without one, and will eventually have such property when queried. - * The interpreter has to manage which one is which. This is the flag that - * helps the management. Objects with this flag set are the ones with - * object IDs assigned. - * - * @internal - * - * But honestly, @shyouhei doesn't think this flag should be visible from - * 3rd parties. It must be an implementation detail that they should never - * know. Might better be hidden. - */ - RUBY_FL_SEEN_OBJ_ID = (1<<9), + /** + * This flag is no longer in use + * + * @internal + */ + RUBY_FL_UNUSED9 = (1<<9), /** * This flag has something to do with instance variables. 3rd parties need -- cgit v1.2.3