Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: runtime/bin/platform.h

Issue 1781883002: Fixes some memory leaks in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix tests on Windows Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/platform.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_PLATFORM_H_ 5 #ifndef BIN_PLATFORM_H_
6 #define BIN_PLATFORM_H_ 6 #define BIN_PLATFORM_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 9
10 10
(...skipping 14 matching lines...) Expand all
25 static const char* OperatingSystem(); 25 static const char* OperatingSystem();
26 26
27 // Returns a string representing the operating system's shared library 27 // Returns a string representing the operating system's shared library
28 // extension (e.g. 'so', 'dll', ...). The returned string should not be 28 // extension (e.g. 'so', 'dll', ...). The returned string should not be
29 // deallocated by the caller. 29 // deallocated by the caller.
30 static const char* LibraryExtension(); 30 static const char* LibraryExtension();
31 31
32 // Extracts the local hostname. 32 // Extracts the local hostname.
33 static bool LocalHostname(char* buffer, intptr_t buffer_length); 33 static bool LocalHostname(char* buffer, intptr_t buffer_length);
34 34
35 // Extracts the environment variables for the current process. The 35 // Extracts the environment variables for the current process. The array of
36 // array of strings returned must be deallocated using 36 // strings is Dart_ScopeAllocated. The number of elements in the array is
37 // FreeEnvironment. The number of elements in the array is returned 37 // returned in the count argument.
38 // in the count argument.
39 static char** Environment(intptr_t* count); 38 static char** Environment(intptr_t* count);
40 static void FreeEnvironment(char** env, intptr_t count);
41 39
42 static char* ResolveExecutablePath(); 40 static const char* ResolveExecutablePath();
43 41
44 // Stores the executable name. 42 // Stores the executable name.
45 static void SetExecutableName(const char* executable_name) { 43 static void SetExecutableName(const char* executable_name) {
46 executable_name_ = executable_name; 44 executable_name_ = executable_name;
47 } 45 }
48 static const char* GetExecutableName() { 46 static const char* GetExecutableName() {
49 return executable_name_; 47 return executable_name_;
50 } 48 }
51 static const char* GetResolvedExecutableName() { 49 static const char* GetResolvedExecutableName() {
52 if (resolved_executable_name_ == NULL) { 50 if (resolved_executable_name_ == NULL) {
(...skipping 27 matching lines...) Expand all
80 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1] 78 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1]
81 79
82 DISALLOW_ALLOCATION(); 80 DISALLOW_ALLOCATION();
83 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); 81 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform);
84 }; 82 };
85 83
86 } // namespace bin 84 } // namespace bin
87 } // namespace dart 85 } // namespace dart
88 86
89 #endif // BIN_PLATFORM_H_ 87 #endif // BIN_PLATFORM_H_
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698