OSDN Git Service

Modified functions to return pointers where appropriate
authorFred Shih <ffred@google.com>
Mon, 2 Jun 2014 18:11:52 +0000 (11:11 -0700)
committerFred Shih <ffred@google.com>
Tue, 3 Jun 2014 02:34:39 +0000 (19:34 -0700)
commit56890e2615ab3dd612f1f81c3cadab6299eceacb
tree4e164a9f5aa3582d9fc5d9051375ce87d2568cc6
parent502a1975e146b288356e49a3af82629637da5ece
Modified functions to return pointers where appropriate

GetStringChars will return a pointer to the underlying char array iff
it is not movable. Otherwise, it will return a copy of the char array.
For consistency, the null terminating character has been removed as the
specification for a jchar strings are not null terminated:

http://developer.android.com/training/articles/perf-jni.html

GetStringCritical will now always return a pointer to the char array.
The char array is pinned and moving gc is disabled until the pointer is
released.

Change-Id: I19c8cbaecc1f3f723d80acec074fb8c5e2d489c3
runtime/jni_internal.cc
runtime/jni_internal_test.cc