OSDN Git Service

Clarify the comment.
authorDan Bornstein <danfuzz@android.com>
Fri, 28 Jan 2011 00:49:30 +0000 (16:49 -0800)
committerDan Bornstein <danfuzz@android.com>
Fri, 28 Jan 2011 00:49:30 +0000 (16:49 -0800)
bcopy() doesn't have a strong spec, so clarify here that it's about
the Bionic implementation.

Change-Id: Icc0e198272b43ae9ccce292ab7f2cdec36a83e49

vm/native/java_lang_System.c

index 4af0dfa..dc04885 100644 (file)
@@ -30,12 +30,13 @@ static void copy(void *dest, const void *src, size_t n, bool sameArray,
         /* Might overlap. */
         if (elemSize == sizeof(Object*)) {
             /*
-             * In addition to handling overlap properly, bcopy()
-             * guarantees atomic treatment of words. This is needed so
-             * that concurrent threads never see half-formed pointers
-             * or ints. The former is required for proper gc behavior,
-             * and the latter is also required for proper high-level
-             * language support.
+             * In addition to handling overlap properly, on Bionic
+             * bcopy() guarantees atomic treatment of words, whereas
+             * Bionic memmove() does not (as of this writing).
+             * Atomicity is needed so that concurrent threads never
+             * see half-formed pointers or ints. The former is
+             * required for proper gc behavior, and the latter is also
+             * required for proper high-level language support.
              *
              * Note: bcopy()'s argument order is different than memcpy().
              */