This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch for Review: JvGetStringUTF and JvTempCString
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- Cc: tromey at redhat dot com, java-patches at gcc dot gnu dot org
- Date: Tue, 12 Aug 2003 10:05:10 -0500
- Subject: Re: Patch for Review: JvGetStringUTF and JvTempCString
- Reply-to: gnustuff at thisiscool dot com
Hi Bryce,
>I totally agree that we have a problem here, I just wonder if this is
>the right solution. Two things that would make me like this better:
>
>1. Can it be made to allocate only the space that it needs on the
>stack?
How? (The only way I can think of doing this in one line is with a macro.)
>Always allocating 500 bytes seems a bit wasteful. I wonder about
>large stack allocations since they will reduce the locality of the
>stack - increasing the chance of cache misses etc.
I was worried about this too, but for embedded targets. I was going to
go lower in my patch (256 bytes). I agree that this isn't perfect.
>2. Can we use _Jv_AllocBytes rather than _Jv_Malloc/_Jv_Free in the
>need-to-allocate case? The former is *faster* given thread local
>allocation, possibly so even after accounting for the GC's marking
>overhead.
I'll happily go with anything you all come up with as long as I don't
have to look at those three lines again. Like I said before, the beauty
of encapsulating this is that we can always tweak it with compile-time
transparency later on.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/