Index: runtime/bin/platform_android.cc |
diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc |
index 3c44c04405a57634b17babfc1b4e328d27bc8377..de60960488540c9c1f973380cc9eccc64e0d9e03 100644 |
--- a/runtime/bin/platform_android.cc |
+++ b/runtime/bin/platform_android.cc |
@@ -14,7 +14,6 @@ |
#include "bin/fdutils.h" |
- |
namespace dart { |
namespace bin { |
@@ -58,9 +57,12 @@ char** Platform::Environment(intptr_t* count) { |
// provide access to modifying environment variables. |
intptr_t i = 0; |
char** tmp = environ; |
- while (*(tmp++) != NULL) i++; |
+ while (*(tmp++) != NULL) { |
+ i++; |
+ } |
*count = i; |
- char** result = new char*[i]; |
+ char** result; |
+ result = reinterpret_cast<char**>(Dart_ScopeAllocate(i * sizeof(*result))); |
for (intptr_t current = 0; current < i; current++) { |
result[current] = environ[current]; |
} |
@@ -68,15 +70,11 @@ char** Platform::Environment(intptr_t* count) { |
} |
-void Platform::FreeEnvironment(char** env, intptr_t count) { |
- delete[] env; |
-} |
- |
- |
-char* Platform::ResolveExecutablePath() { |
+const char* Platform::ResolveExecutablePath() { |
return File::LinkTarget("/proc/self/exe"); |
} |
+ |
void Platform::Exit(int exit_code) { |
exit(exit_code); |
} |