RFR: 8247912: Make narrowOop a scoped enum [v2]

Ioi Lam iklam at openjdk.java.net
Thu Sep 24 13:19:43 UTC 2020


On Tue, 22 Sep 2020 15:45:01 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> > > Also, should we allow only unsigned types for T? I think using signed types here is prone to error and should be
> > > flagged.
> > 
> > 
> > It turns out we can't restrict it to unsigned types, at least not very easily. For example,
> > CDS calls this with an intptr_t value. I suppose CDS could do conversion itself before
> > calling this, but that seems a little odd. And I don't know how many more there are after
> > changing that one.
> 
> But shouldn't intptr_t be unsigned? I tested with this:

Oops, my mistake. I thought `intptr_t` was `int*`, but it's in fact "Integer type capable of holding a value converted
from a void pointer and then be converted back to that type with a value that compares equal to the original pointer."

-------------

PR: https://git.openjdk.java.net/jdk/pull/273


More information about the shenandoah-dev mailing list