http://code.google.com/p/v8/issues/detail?id=444
Review URL: http://codereview.chromium.org/243027
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2978
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
ASSERT(blocks_.length() == 0);
ASSERT(entered_contexts_.length() == 0);
ASSERT(saved_contexts_.length() == 0);
+ blocks_.Free();
+ entered_contexts_.Free();
+ saved_contexts_.Free();
if (spare_ != NULL) {
DeleteArray(spare_);
spare_ = NULL;
INLINE(explicit List(int capacity)) { Initialize(capacity); }
INLINE(~List()) { DeleteData(data_); }
+ // Deallocates memory used by the list and leaves the list in a consistent
+ // empty state.
+ void Free() {
+ DeleteData(data_);
+ Initialize(0);
+ }
+
INLINE(void* operator new(size_t size)) { return P::New(size); }
INLINE(void operator delete(void* p, size_t)) { return P::Delete(p); }