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

Side by Side Diff: src/platform.h

Issue 42329: Getting rid of OS::StrDup and OS::StrNDup which were sometimes misused. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/platform-freebsd.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 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 // Safe formatting print. Ensures that str is always null-terminated. 222 // Safe formatting print. Ensures that str is always null-terminated.
223 // Returns the number of chars written, or -1 if output was truncated. 223 // Returns the number of chars written, or -1 if output was truncated.
224 static int SNPrintF(Vector<char> str, const char* format, ...); 224 static int SNPrintF(Vector<char> str, const char* format, ...);
225 static int VSNPrintF(Vector<char> str, 225 static int VSNPrintF(Vector<char> str,
226 const char* format, 226 const char* format,
227 va_list args); 227 va_list args);
228 228
229 static char* StrChr(char* str, int c); 229 static char* StrChr(char* str, int c);
230 static void StrNCpy(Vector<char> dest, const char* src, size_t n); 230 static void StrNCpy(Vector<char> dest, const char* src, size_t n);
231 static char* StrDup(const char* str);
232 static char* StrNDup(const char* str, size_t n);
233 231
234 // Support for profiler. Can do nothing, in which case ticks 232 // Support for profiler. Can do nothing, in which case ticks
235 // occuring in shared libraries will not be properly accounted 233 // occuring in shared libraries will not be properly accounted
236 // for. 234 // for.
237 static void LogSharedLibraryAddresses(); 235 static void LogSharedLibraryAddresses();
238 236
239 // Returns the double constant NAN 237 // Returns the double constant NAN
240 static double nan_value(); 238 static double nan_value();
241 239
242 // Returns the activation frame alignment constraint or zero if 240 // Returns the activation frame alignment constraint or zero if
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 bool active_; 496 bool active_;
499 PlatformData* data_; // Platform specific data. 497 PlatformData* data_; // Platform specific data.
500 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 498 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
501 }; 499 };
502 500
503 #endif // ENABLE_LOGGING_AND_PROFILING 501 #endif // ENABLE_LOGGING_AND_PROFILING
504 502
505 } } // namespace v8::internal 503 } } // namespace v8::internal
506 504
507 #endif // V8_PLATFORM_H_ 505 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « no previous file | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698