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

Unified Diff: src/objects-printer.cc

Issue 7523052: String to ascii char array converter for debug mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index fa03447a3b9563ee8e24503ed667275a5193b26a..cc66e93c42f228169f23db1291aa63822dd39140 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -560,6 +560,17 @@ void String::StringPrint(FILE* out) {
}
+char* String::ToAsciiArray() {
+ static char* buffer = NULL;
Sven Panne 2011/07/29 09:31:46 Drive-by commment: This looks scary... The real pr
+ if (buffer != NULL)
Rico 2011/07/29 09:18:07 { } around if body unless moved to same line
+ free(buffer);
+ buffer = new char[length()+1];
+ WriteToFlat(this, buffer, 0, length());
+ buffer[length()] = 0;
+ return buffer;
+}
+
+
void JSProxy::JSProxyPrint(FILE* out) {
HeapObject::PrintHeader(out, "JSProxy");
PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698