[kaffe] libraries/clib/native/{Double,Float}.c issues

Dalibor Topic robilad at kaffe.org
Fri Oct 22 14:16:27 PDT 2004


Eric Anholt wrote:

Hi Eric,

thanks for the patch! I've checked it in with one small change: I've 
left out the hunk in Float.c below.

> However, I'm still seeing insanely long times to run simple tests like 
> DoublePrint.java.  Not sure what's going on here.

you could try kaffe -prof DoublePrint with an installed version, and 
then look into the profiling output. I'm not sure whether that works on 
amd64, but it may be worth trying out.

> Index: libraries/clib/native/Float.c
> ===================================================================
> RCS file: /cvs/kaffe/kaffe/libraries/clib/native/Float.c,v
> retrieving revision 1.14
> diff -u -r1.14 Float.c
> --- libraries/clib/native/Float.c	21 May 2004 15:19:24 -0000	1.14
> +++ libraries/clib/native/Float.c	21 Oct 2004 07:56:25 -0000
> @@ -144,7 +145,7 @@
>  	}
>  #endif
>  /* Parse value; check for empty parse */
> -	value = (float) strtod(buf, &endbuf);
> +	value = strtof(buf, &endbuf);
>  	if (endbuf == buf) {
>  		msg = startbuf;		/* this is what JDK 1.1.6 does */
>  		goto bail;

If one uses strtof here, the resulting strings are not correct, afaict, 
for exponent-less floats.

cheers,
dalibor topic




More information about the kaffe mailing list