OSDN Git Service
(root)
/
android-x86
/
dalvik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Invert sense of a test.
[android-x86/dalvik.git]
/
vm
/
Misc.cpp
diff --git
a/vm/Misc.cpp
b/vm/Misc.cpp
index
1299c22
..
057b90d
100644
(file)
--- a/
vm/Misc.cpp
+++ b/
vm/Misc.cpp
@@
-512,7
+512,12
@@
u8 dvmGetOtherThreadCpuTimeNsec(pthread_t thread)
*/
bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
{
*/
bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
{
- const int minSleep = 10000;
+ /*
+ * Minimum sleep is one millisecond, it is important to keep this value
+ * low to ensure short GC pauses since dvmSuspendAllThreads() uses this
+ * function.
+ */
+ const int minSleep = 1000;
u8 curTime;
int curDelay;
u8 curTime;
int curDelay;
@@
-619,6
+624,7
@@
void *dvmAllocRegion(size_t byteCount, int prot, const char *name) {
return NULL;
}
if (ret == -1) {
return NULL;
}
if (ret == -1) {
+ munmap(base, byteCount);
return NULL;
}
return base;
return NULL;
}
return base;
@@
-694,8
+700,10
@@
bool dvmGetThreadStats(ProcStatData* pData, pid_t tid)
char* cp = strchr(lineBuf, ')');
if (cp == NULL)
goto parse_fail;
char* cp = strchr(lineBuf, ')');
if (cp == NULL)
goto parse_fail;
- cp++;
- for (i = 2; i < 13; i++) {
+ cp += 2;
+ pData->state = *cp++;
+
+ for (i = 3; i < 13; i++) {
cp = strchr(cp+1, ' ');
if (cp == NULL)
goto parse_fail;
cp = strchr(cp+1, ' ');
if (cp == NULL)
goto parse_fail;