Minor cleanup: the smartpointer class should use DeleteArray to
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 4 Sep 2008 13:09:12 +0000 (13:09 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 4 Sep 2008 13:09:12 +0000 (13:09 +0000)
deallocate.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc
src/smart-pointer.h

index 87e07d9..2be4ccd 100644 (file)
@@ -2968,9 +2968,9 @@ SmartPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
 }
 
 
-SmartPointer < char >String::ToCString(AllowNullsFlag allow_nulls,
-                                       RobustnessFlag robust_flag,
-                                       int* length_return) {
+SmartPointer<char> String::ToCString(AllowNullsFlag allow_nulls,
+                                     RobustnessFlag robust_flag,
+                                     int* length_return) {
   return ToCString(allow_nulls, robust_flag, 0, -1, length_return);
 }
 
index 3fe27d4..7ff35c2 100644 (file)
@@ -41,9 +41,9 @@ class SmartPointer {
 
 
   // When the destructor of the scoped pointer is executed the plain pointer
-  // is deleted using delete[].  This implies that you must allocate with
-  // new[...], not new(...).
-  inline ~SmartPointer() { if (p) delete [] p; }
+  // is deleted using DeleteArray.  This implies that you must allocate with
+  // NewArray.
+  inline ~SmartPointer() { if (p) DeleteArray(p); }
 
 
   // Copy constructor removes the pointer from the original to avoid double