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

Side by Side Diff: src/string-stream.cc

Issue 7860011: Rename SmartPointer to SmartArrayPointer. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: rebase it again to get more fixes Created 9 years, 3 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
« no previous file with comments | « src/string-stream.h ('k') | src/x64/lithium-codegen-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 246
247 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, 247 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1,
248 FmtElm arg2, FmtElm arg3) { 248 FmtElm arg2, FmtElm arg3) {
249 const char argc = 4; 249 const char argc = 4;
250 FmtElm argv[argc] = { arg0, arg1, arg2, arg3 }; 250 FmtElm argv[argc] = { arg0, arg1, arg2, arg3 };
251 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); 251 Add(CStrVector(format), Vector<FmtElm>(argv, argc));
252 } 252 }
253 253
254 254
255 SmartPointer<const char> StringStream::ToCString() const { 255 SmartArrayPointer<const char> StringStream::ToCString() const {
256 char* str = NewArray<char>(length_ + 1); 256 char* str = NewArray<char>(length_ + 1);
257 memcpy(str, buffer_, length_); 257 memcpy(str, buffer_, length_);
258 str[length_] = '\0'; 258 str[length_] = '\0';
259 return SmartPointer<const char>(str); 259 return SmartArrayPointer<const char>(str);
260 } 260 }
261 261
262 262
263 void StringStream::Log() { 263 void StringStream::Log() {
264 LOG(ISOLATE, StringEvent("StackDump", buffer_)); 264 LOG(ISOLATE, StringEvent("StackDump", buffer_));
265 } 265 }
266 266
267 267
268 void StringStream::OutputToFile(FILE* out) { 268 void StringStream::OutputToFile(FILE* out) {
269 // Dump the output to stdout, but make sure to break it up into 269 // Dump the output to stdout, but make sure to break it up into
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 // Only grow once to the maximum allowable size. 586 // Only grow once to the maximum allowable size.
587 char* NoAllocationStringAllocator::grow(unsigned* bytes) { 587 char* NoAllocationStringAllocator::grow(unsigned* bytes) {
588 ASSERT(size_ >= *bytes); 588 ASSERT(size_ >= *bytes);
589 *bytes = size_; 589 *bytes = size_;
590 return space_; 590 return space_;
591 } 591 }
592 592
593 593
594 } } // namespace v8::internal 594 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/string-stream.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698