Commit 138607df by Alexandre Oliva Committed by Tom Tromey

natSystem.cc (arraycopy): Use bcopy if memmove is not available.

1999-07-31  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* java/lang/natSystem.cc (arraycopy): Use bcopy if memmove is not
	available.  Don't cast memmove args to (void*).
	* configure.in: Do not abort if memmove is not available.

From-SVN: r28360
parent 048fc686
1999-07-31 Alexandre Oliva <oliva@dcc.unicamp.br>
* java/lang/natSystem.cc (arraycopy): Use bcopy if memmove is not
available. Don't cast memmove args to (void*).
* configure.in: Do not abort if memmove is not available.
1999-07-22 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/natString.cc (substring): optimize where substring is
......
......@@ -342,12 +342,7 @@ else
AC_MSG_ERROR([no function found to get the time])
fi
# We require memmove.
memmove_found=no
AC_CHECK_FUNCS(memmove, memmove_found=yes)
if test "$memmove_found" = no; then
AC_MSG_ERROR([memmove is required])
fi
AC_CHECK_FUNCS(memmove)
# We require memcpy.
memcpy_found=no
......
......@@ -171,9 +171,14 @@ java::lang::System::arraycopy (jobject src, jint src_offset,
dst_elts = (char *) elements ((jdoubleArray) dst);
dst_elts += size * dst_offset;
#if HAVE_MEMMOVE
// We don't bother trying memcpy. It can't be worth the cost of
// the check.
memmove ((void *) dst_elts, (void *) src_elts, count * size);
// Don't cast to (void*), as memmove may expect (char*)
memmove (dst_elts, src_elts, count * size);
#else
bcopy (src_elts, dst_elts, count * size);
#endif
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment