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

Re: Misplaced memset?


>>>>> "Angelo" == Angelo Corsaro <corsaro@ece.uci.edu> writes:

Angelo> I think that the memset following in the following code should
Angelo> be moved to _Jv_AllocPtrFreeObj. I think it is better to
Angelo> assume as precondition that all the allocators give back
Angelo> zeroed memory.

I may be misunderstanding (and hopefully Hans will correct me if so),
but I think in this case _Jv_AllocPtrFreeObj is not required to return
zeroed memory for performance reasons.  There are other places where
we call this function, places where zeroing the memory would be
redundant work (since we immediately and fully initialize the returned
object -- e.g. see the String case).

Angelo> Otherwise there is the danger that we have in the GCJ runtime
Angelo> code that is there only to deal with specific characteristics
Angelo> of the Boehm GC.

Since our only public GC is the Boehm GC, our policy has basically
been that we'll make changes to the interface if it makes libgcj work
better with this GC.

I suppose in this case another option would be to add some kind of
configury tweak -- either a define set by the collector being used
(that would toggle whether or not the memset is required) or a new
inline function called from that location only (which for the Boehm
case would call memset).

At the very least we could document this a bit better.

Angelo> I detected this change since it was affecting the performances
Angelo> of my allocators.

Interesting.  Why do you have your own allocator?  What does it do
differently?

Tom


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