Re: Will it be worthy to add some public static final empty arrays for some most used types in some place in java.base, other than create them multi times in several places?

2021-10-09 Thread Xeno Amess
sample codes here https://github.com/openjdk/jdk/pull/5874 if anyone
interested


Xeno Amess  于2021年10月10日周日 上午4:00写道:

> sigh.
>
> quite some good things I always want are at valhalla
> , but I just don't think
> they will come stable soon.
>
> hope me be wrong.
>
>
> Pavel Rappo  于2021年10月10日周日 上午1:54写道:
>
>> Empty? As in arrays of length zero?
>>
>> There ought to be a much better solution. I'm neither an expert nor
>> (sadly) an active follower of the Valhalla project [1]. Perhaps something
>> there or in Frozen Arrays [2] will address the runtime cost of creating
>> zero-length arrays much more elegantly.
>>
>> [1] https://openjdk.java.net/projects/valhalla/
>> [2] https://openjdk.java.net/jeps/8261007
>>
>> -Pavel
>>
>> > On 9 Oct 2021, at 18:19, Xeno Amess  wrote:
>> >
>> > I suggest putting them in Arrays btw.
>>
>>


Re: Will it be worthy to add some public static final empty arrays for some most used types in some place in java.base, other than create them multi times in several places?

2021-10-09 Thread Xeno Amess
sigh.

quite some good things I always want are at valhalla
, but I just don't think they
will come stable soon.

hope me be wrong.


Pavel Rappo  于2021年10月10日周日 上午1:54写道:

> Empty? As in arrays of length zero?
>
> There ought to be a much better solution. I'm neither an expert nor
> (sadly) an active follower of the Valhalla project [1]. Perhaps something
> there or in Frozen Arrays [2] will address the runtime cost of creating
> zero-length arrays much more elegantly.
>
> [1] https://openjdk.java.net/projects/valhalla/
> [2] https://openjdk.java.net/jeps/8261007
>
> -Pavel
>
> > On 9 Oct 2021, at 18:19, Xeno Amess  wrote:
> >
> > I suggest putting them in Arrays btw.
>
>


Re: Will it be worthy to add some public static final empty arrays for some most used types in some place in java.base, other than create them multi times in several places?

2021-10-09 Thread Pavel Rappo
Empty? As in arrays of length zero?

There ought to be a much better solution. I'm neither an expert nor (sadly) an 
active follower of the Valhalla project [1]. Perhaps something there or in 
Frozen Arrays [2] will address the runtime cost of creating zero-length arrays 
much more elegantly.

[1] https://openjdk.java.net/projects/valhalla/
[2] https://openjdk.java.net/jeps/8261007

-Pavel

> On 9 Oct 2021, at 18:19, Xeno Amess  wrote:
> 
> I suggest putting them in Arrays btw.



Will it be worthy to add some public static final empty arrays for some most used types in some place in java.base, other than create them multi times in several places?

2021-10-09 Thread Xeno Amess
I suggest putting them in Arrays btw.