This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

default initialization [was: Re: Socket timeout patch]


One last comment on the issue:

The compiler IS allowed to omit default initializers in array
initializations (and that's the only place):

new int[] { 0, 0 };

Here, the compiler can stop after the newarray bytecode; rather than
going on and assigning 0 to slots 0 and 1 of the new array. This is
possible because unlike new instances or loaded classees, nothing has
access to the array being created until it is completely initialized.

Eric Blake wrote:
> 
> and say instead that a compiler may NOT omit default initializations,
> not even for static fields:

-- 
This signature intentionally left boring.

Eric Blake             ebb9@email.byu.edu
  BYU student, free software programmer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]