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

Side by Side Diff: src/platform-linux.cc

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 | « src/platform-freebsd.cc ('k') | src/platform-macos.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 char* OS::StrChr(char* str, int c) { 189 char* OS::StrChr(char* str, int c) {
190 return strchr(str, c); 190 return strchr(str, c);
191 } 191 }
192 192
193 193
194 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { 194 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) {
195 strncpy(dest.start(), src, n); 195 strncpy(dest.start(), src, n);
196 } 196 }
197 197
198 198
199 char* OS::StrDup(const char* str) {
200 return strdup(str);
201 }
202
203
204 char* OS::StrNDup(const char* str, size_t n) {
205 return strndup(str, n);
206 }
207
208
209 double OS::nan_value() { 199 double OS::nan_value() {
210 return NAN; 200 return NAN;
211 } 201 }
212 202
213 203
214 int OS::ActivationFrameAlignment() { 204 int OS::ActivationFrameAlignment() {
215 // Floating point code runs faster if the stack is 8-byte aligned. 205 // Floating point code runs faster if the stack is 8-byte aligned.
216 return 8; 206 return 8;
217 } 207 }
218 208
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 } 844 }
855 845
856 // This sampler is no longer the active sampler. 846 // This sampler is no longer the active sampler.
857 active_sampler_ = NULL; 847 active_sampler_ = NULL;
858 active_ = false; 848 active_ = false;
859 } 849 }
860 850
861 #endif // ENABLE_LOGGING_AND_PROFILING 851 #endif // ENABLE_LOGGING_AND_PROFILING
862 852
863 } } // namespace v8::internal 853 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698