Use bionic's dlmalloc 2.8.5.
Also fix free space computations for DDMS.
Change-Id: Icbc045b5461af89a0516f37f01acaaa815205348
diff --git a/src/jdwp/jdwp_event.cc b/src/jdwp/jdwp_event.cc
index 0e7bb99..0eb2930 100644
--- a/src/jdwp/jdwp_event.cc
+++ b/src/jdwp/jdwp_event.cc
@@ -1070,13 +1070,25 @@
wrapiov[0].iov_base = header;
wrapiov[0].iov_len = sizeof(header);
- /*
- * Make sure we're in VMWAIT in case the write blocks.
- */
+ // Try to avoid blocking GC during a send, but only safe when not using mutexes at a lower-level
+ // than mutator for lock ordering reasons.
Thread* self = Thread::Current();
- self->TransitionFromRunnableToSuspended(kWaitingForDebuggerSend);
- (*transport_->sendBufferedRequest)(this, wrapiov, iov_count + 1);
- self->TransitionFromSuspendedToRunnable();
+ bool safe_to_release_mutator_lock_over_send;
+ for (size_t i=0; i < kMutatorLock; ++i) {
+ if (self->GetHeldMutex(static_cast<MutexLevel>(i)) != NULL) {
+ safe_to_release_mutator_lock_over_send = false;
+ break;
+ }
+ }
+ if (safe_to_release_mutator_lock_over_send) {
+ // Change state to waiting to allow GC, ... while we're sending.
+ self->TransitionFromRunnableToSuspended(kWaitingForDebuggerSend);
+ (*transport_->sendBufferedRequest)(this, wrapiov, iov_count + 1);
+ self->TransitionFromSuspendedToRunnable();
+ } else {
+ // Send and possibly block GC...
+ (*transport_->sendBufferedRequest)(this, wrapiov, iov_count + 1);
+ }
}
} // namespace JDWP