OLD | NEW |
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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
7 | 7 |
8 #include "vm/os.h" | 8 #include "vm/os.h" |
9 | 9 |
10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
11 #include <limits.h> // NOLINT | 11 #include <limits.h> // NOLINT |
12 #include <malloc.h> // NOLINT | 12 #include <malloc.h> // NOLINT |
13 #include <time.h> // NOLINT | 13 #include <time.h> // NOLINT |
14 #include <sys/resource.h> // NOLINT | 14 #include <sys/resource.h> // NOLINT |
15 #include <sys/time.h> // NOLINT | 15 #include <sys/time.h> // NOLINT |
16 #include <sys/types.h> // NOLINT | 16 #include <sys/types.h> // NOLINT |
17 #include <sys/syscall.h> // NOLINT | 17 #include <sys/syscall.h> // NOLINT |
18 #include <sys/stat.h> // NOLINT | 18 #include <sys/stat.h> // NOLINT |
19 #include <fcntl.h> // NOLINT | 19 #include <fcntl.h> // NOLINT |
20 #include <unistd.h> // NOLINT | 20 #include <unistd.h> // NOLINT |
21 | 21 |
| 22 #include "platform/memory_sanitizer.h" |
22 #include "platform/utils.h" | 23 #include "platform/utils.h" |
23 #include "vm/code_observers.h" | 24 #include "vm/code_observers.h" |
24 #include "vm/dart.h" | 25 #include "vm/dart.h" |
25 #include "vm/flags.h" | 26 #include "vm/flags.h" |
26 #include "vm/isolate.h" | 27 #include "vm/isolate.h" |
27 #include "vm/lockers.h" | 28 #include "vm/lockers.h" |
28 #include "vm/os_thread.h" | 29 #include "vm/os_thread.h" |
29 #include "vm/zone.h" | 30 #include "vm/zone.h" |
30 | 31 |
31 | 32 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 int OS::SNPrint(char* str, size_t size, const char* format, ...) { | 315 int OS::SNPrint(char* str, size_t size, const char* format, ...) { |
315 va_list args; | 316 va_list args; |
316 va_start(args, format); | 317 va_start(args, format); |
317 int retval = VSNPrint(str, size, format, args); | 318 int retval = VSNPrint(str, size, format, args); |
318 va_end(args); | 319 va_end(args); |
319 return retval; | 320 return retval; |
320 } | 321 } |
321 | 322 |
322 | 323 |
323 int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) { | 324 int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) { |
| 325 MSAN_UNPOISON(str, size); |
324 int retval = vsnprintf(str, size, format, args); | 326 int retval = vsnprintf(str, size, format, args); |
325 if (retval < 0) { | 327 if (retval < 0) { |
326 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format); | 328 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format); |
327 } | 329 } |
328 return retval; | 330 return retval; |
329 } | 331 } |
330 | 332 |
331 | 333 |
332 char* OS::SCreate(Zone* zone, const char* format, ...) { | 334 char* OS::SCreate(Zone* zone, const char* format, ...) { |
333 va_list args; | 335 va_list args; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 } | 419 } |
418 | 420 |
419 | 421 |
420 void OS::Exit(int code) { | 422 void OS::Exit(int code) { |
421 exit(code); | 423 exit(code); |
422 } | 424 } |
423 | 425 |
424 } // namespace dart | 426 } // namespace dart |
425 | 427 |
426 #endif // defined(TARGET_OS_LINUX) | 428 #endif // defined(TARGET_OS_LINUX) |
OLD | NEW |