This is the mail archive of the 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]

Re: Garbage collector problem ???

Alexandre Petit-Bianco <> writes:

> Boehm, Hans writes:
> > That would be safe for Java arrays if we knew that the compiler
> > always kept a pointer to the array itself while the array could
> > still be dereferenced.
> You mean (1) always address an array element with an arithmetic that
> starts from the pointer to the array object? Or (2) always keep a
> pointer to the array object around, while addressing on of its
> element?
> The current front-end does (1), though this can be optimized in weird
> ways. I'm not sure (2) is guaranteed, because of optimizations.

Because Java arrays are objects and hold things besides just the
array, I'd actually be suprised if (2) wasn't maintained for Java
arrays.  If it wasn't, I doubt it would be maintained for normal
objects, either.

> > I believe currently the front end ensures that, but not in a way
> > that ensures the back end will preserve the property.
> I'll see if some hints can be passed to the middle and back-end.

Getting hints from the Java portion of the compiler is probably not
good enough.  I'd actually be more concerned about the C and C++
portions of the compiler.  The C libraries might also be a problem.
The strhash stuff (for String.intern()) would be once case where this
might happen, and anything that deals directly with arrays from C++
would be suspect.


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