Issue #18059 has been updated by duerst (Martin D=FCrst).


duerst (Martin D=FCrst) wrote in #note-6:
> Dan0042 (Daniel DeLorme) wrote in #note-4:
> =

> > Actually I have so many questions about flags,...
> > It would be nice if there was some documentation somewhere about flags =
and how they are used. Even just comments in the code. I haven't found much=
 so far.
> =

> Yes, please!

Sorry, I should have been more specific the first time round. One question =
is whether extension libraries are allowed to use some flags. The other que=
stion is what flags may still be free for new work on Ruby internals.

----------------------------------------
Misc #18059: Which FL_USERx are open to extension libraries?
https://bugs.ruby-lang.org/issues/18059#change-93108

* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
----------------------------------------
Often the following failure occurs in `test-spec`.

```
RBasic support for regular objects supports copying the flags from one obje=
ct over to the other FAILED
Expected 81920 =3D=3D 33636352
to be truthy but was false
/tmp/ruby/v3/src/trunk/spec/ruby/optional/capi/shared/rbasic.rb:71:in `bloc=
k (2 levels) in <top (required)>'
/tmp/ruby/v3/src/trunk/spec/ruby/optional/capi/rbasic_spec.rb:8:in `<top (r=
equired)>'
```

`81920    =3D=3D   0x14000`
`33636352 =3D=3D 0x2014000`
The difference `0x2000000` is `FL_USER13`, which is used as `ROBJECT_TRANSI=
ENT_FLAG`.
This flag is set when any `Object` instance has some amount of instance var=
iables.

In this particular case, it is possible to fix just by excluding the bit.
But, the question is which flags are open to extension libraries.

My guess is these flags are available for `T_DATA` classes, but not for `T_=
OBJECT`.
Any thoughts?



-- =

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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>