Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 // Safe formatting print. Ensures that str is always null-terminated. | 235 // Safe formatting print. Ensures that str is always null-terminated. |
| 236 // Returns the number of chars written, or -1 if output was truncated. | 236 // Returns the number of chars written, or -1 if output was truncated. |
| 237 static int SNPrintF(Vector<char> str, const char* format, ...); | 237 static int SNPrintF(Vector<char> str, const char* format, ...); |
| 238 static int VSNPrintF(Vector<char> str, | 238 static int VSNPrintF(Vector<char> str, |
| 239 const char* format, | 239 const char* format, |
| 240 va_list args); | 240 va_list args); |
| 241 | 241 |
| 242 static char* StrChr(char* str, int c); | 242 static char* StrChr(char* str, int c); |
| 243 | |
| 244 // Calls strncpy in POSIX and strncpy_s in Windows. It means that | |
|
Mads Ager (chromium)
2010/01/19 16:07:06
I think it would make more sense to change the imp
Søren Thygesen Gjesse
2010/01/19 16:13:06
Then we should probably stick to the strncpy_s sem
| |
| 245 // depending on platform it may or may not set terminating 0 and | |
| 246 // it may or may not check length of dest buffer (dest must fit | |
| 247 // n bytes plus 1 terminating byte). | |
| 243 static void StrNCpy(Vector<char> dest, const char* src, size_t n); | 248 static void StrNCpy(Vector<char> dest, const char* src, size_t n); |
| 244 | 249 |
| 245 // Support for profiler. Can do nothing, in which case ticks | 250 // Support for profiler. Can do nothing, in which case ticks |
| 246 // occuring in shared libraries will not be properly accounted | 251 // occuring in shared libraries will not be properly accounted |
| 247 // for. | 252 // for. |
| 248 static void LogSharedLibraryAddresses(); | 253 static void LogSharedLibraryAddresses(); |
| 249 | 254 |
| 250 // The return value indicates the CPU features we are sure of because of the | 255 // The return value indicates the CPU features we are sure of because of the |
| 251 // OS. For example MacOSX doesn't run on any x86 CPUs that don't have SSE2 | 256 // OS. For example MacOSX doesn't run on any x86 CPUs that don't have SSE2 |
| 252 // instructions. | 257 // instructions. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 bool active_; | 552 bool active_; |
| 548 PlatformData* data_; // Platform specific data. | 553 PlatformData* data_; // Platform specific data. |
| 549 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 554 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 550 }; | 555 }; |
| 551 | 556 |
| 552 #endif // ENABLE_LOGGING_AND_PROFILING | 557 #endif // ENABLE_LOGGING_AND_PROFILING |
| 553 | 558 |
| 554 } } // namespace v8::internal | 559 } } // namespace v8::internal |
| 555 | 560 |
| 556 #endif // V8_PLATFORM_H_ | 561 #endif // V8_PLATFORM_H_ |
| OLD | NEW |