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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 int n = vsnprintf(str.start(), str.length(), format, args); | 177 int n = vsnprintf(str.start(), str.length(), format, args); |
178 if (n < 0 || n >= str.length()) { | 178 if (n < 0 || n >= str.length()) { |
179 str[str.length() - 1] = '\0'; | 179 str[str.length() - 1] = '\0'; |
180 return -1; | 180 return -1; |
181 } else { | 181 } else { |
182 return n; | 182 return n; |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 | 186 |
| 187 char* OS::StrChr(char* str, int c) { |
| 188 return strchr(str, c); |
| 189 } |
| 190 |
| 191 |
187 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { | 192 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { |
188 strncpy(dest.start(), src, n); | 193 strncpy(dest.start(), src, n); |
189 } | 194 } |
190 | 195 |
191 | 196 |
192 char *OS::StrDup(const char* str) { | 197 char *OS::StrDup(const char* str) { |
193 return strdup(str); | 198 return strdup(str); |
194 } | 199 } |
195 | 200 |
196 | 201 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 } | 713 } |
709 | 714 |
710 // This sampler is no longer the active sampler. | 715 // This sampler is no longer the active sampler. |
711 active_sampler_ = NULL; | 716 active_sampler_ = NULL; |
712 active_ = false; | 717 active_ = false; |
713 } | 718 } |
714 | 719 |
715 #endif // ENABLE_LOGGING_AND_PROFILING | 720 #endif // ENABLE_LOGGING_AND_PROFILING |
716 | 721 |
717 } } // namespace v8::internal | 722 } } // namespace v8::internal |
OLD | NEW |