diff --git a/js/js2/gc_allocator.cpp b/js/js2/gc_allocator.cpp index 8923852a230c..78b5de6fb6e5 100644 --- a/js/js2/gc_allocator.cpp +++ b/js/js2/gc_allocator.cpp @@ -84,8 +84,7 @@ void main(int /* argc */, char* /* argv[] */) cout << "testing the GC allocator." << endl; typedef gc_types::string char_string; - auto_ptr ptr(new char_string("This is a garbage collectable string.")); - char_string& str = *ptr; + char_string str("This is a garbage collectable string."); cout << str << endl; // question, how can we partially evaluate a template? @@ -104,9 +103,9 @@ void main(int /* argc */, char* /* argv[] */) // allocate an object that has a finalizer to call its destructor. A* a = new A(); } - + // run a collection. - GC_gcollect(); + gc_allocator::collect(); // sort the values. sort(values.begin(), values.end()); diff --git a/js2/src/gc_allocator.cpp b/js2/src/gc_allocator.cpp index 8923852a230c..78b5de6fb6e5 100644 --- a/js2/src/gc_allocator.cpp +++ b/js2/src/gc_allocator.cpp @@ -84,8 +84,7 @@ void main(int /* argc */, char* /* argv[] */) cout << "testing the GC allocator." << endl; typedef gc_types::string char_string; - auto_ptr ptr(new char_string("This is a garbage collectable string.")); - char_string& str = *ptr; + char_string str("This is a garbage collectable string."); cout << str << endl; // question, how can we partially evaluate a template? @@ -104,9 +103,9 @@ void main(int /* argc */, char* /* argv[] */) // allocate an object that has a finalizer to call its destructor. A* a = new A(); } - + // run a collection. - GC_gcollect(); + gc_allocator::collect(); // sort the values. sort(values.begin(), values.end());