OSDN Git Service

Runtime::PreZygoteFork returns void, not boolean.
authorNarayan Kamath <narayan@google.com>
Wed, 2 Apr 2014 11:54:23 +0000 (12:54 +0100)
committerNarayan Kamath <narayan@google.com>
Wed, 2 Apr 2014 11:54:23 +0000 (12:54 +0100)
This method aborts on failure (as it should) and unconditionally
returns true, so making it return void simplifies callers.

Change-Id: Iae39bd327f20311579ece47efa8afd1be7defce9

runtime/native/dalvik_system_ZygoteHooks.cc
runtime/runtime.cc
runtime/runtime.h

index 2af5324..1008491 100644 (file)
@@ -91,9 +91,8 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
 static jlong ZygoteHooks_nativePreFork(JNIEnv* env, jclass) {
   Runtime* runtime = Runtime::Current();
   CHECK(runtime->IsZygote()) << "runtime instance not started with -Xzygote";
-  if (!runtime->PreZygoteFork()) {
-    LOG(FATAL) << "pre-fork heap failed";
-  }
+
+  runtime->PreZygoteFork();
 
   // Grab thread before fork potentially makes Thread::pthread_key_self_ unusable.
   Thread* self = Thread::Current();
index a830018..9d2cb96 100644 (file)
@@ -269,9 +269,8 @@ void Runtime::Abort() {
   // notreached
 }
 
-bool Runtime::PreZygoteFork() {
+void Runtime::PreZygoteFork() {
   heap_->PreZygoteFork();
-  return true;
 }
 
 void Runtime::CallExitHook(jint status) {
index ed60d4d..8c3ef0e 100644 (file)
@@ -355,7 +355,7 @@ class Runtime {
 
   void SetStatsEnabled(bool new_state);
 
-  bool PreZygoteFork();
+  void PreZygoteFork();
   bool InitZygote();
   void DidForkFromZygote();