can't use operator new to allocate containers that use GC_allocator, because the Mac heap zone isn't scanned.

This commit is contained in:
beard%netscape.com 2000-03-02 21:06:36 +00:00
Родитель 666b7fec85
Коммит 8875ed1f5c
2 изменённых файлов: 6 добавлений и 8 удалений

Просмотреть файл

@ -84,8 +84,7 @@ void main(int /* argc */, char* /* argv[] */)
cout << "testing the GC allocator." << endl;
typedef gc_types<char>::string char_string;
auto_ptr<char_string> 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<void>::collect();
// sort the values.
sort(values.begin(), values.end());

Просмотреть файл

@ -84,8 +84,7 @@ void main(int /* argc */, char* /* argv[] */)
cout << "testing the GC allocator." << endl;
typedef gc_types<char>::string char_string;
auto_ptr<char_string> 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<void>::collect();
// sort the values.
sort(values.begin(), values.end());