This is the mail archive of the
mailing list for the Java project.
Re: Garbage collector problem ???
Alexandre Petit-Bianco <email@example.com> 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
> 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
> > 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.