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

Side by Side Diff: src/api.h

Issue 243027: Fix the last memory leak demonstrated by the test program in... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 saved_contexts_.Initialize(0); 362 saved_contexts_.Initialize(0);
363 spare_ = NULL; 363 spare_ = NULL;
364 ignore_out_of_memory_ = false; 364 ignore_out_of_memory_ = false;
365 call_depth_ = 0; 365 call_depth_ = 0;
366 } 366 }
367 367
368 void Free() { 368 void Free() {
369 ASSERT(blocks_.length() == 0); 369 ASSERT(blocks_.length() == 0);
370 ASSERT(entered_contexts_.length() == 0); 370 ASSERT(entered_contexts_.length() == 0);
371 ASSERT(saved_contexts_.length() == 0); 371 ASSERT(saved_contexts_.length() == 0);
372 blocks_.Free();
373 entered_contexts_.Free();
374 saved_contexts_.Free();
372 if (spare_ != NULL) { 375 if (spare_ != NULL) {
373 DeleteArray(spare_); 376 DeleteArray(spare_);
374 spare_ = NULL; 377 spare_ = NULL;
375 } 378 }
376 ASSERT(call_depth_ == 0); 379 ASSERT(call_depth_ == 0);
377 } 380 }
378 381
379 List<internal::Object**> blocks_; 382 List<internal::Object**> blocks_;
380 // Used as a stack to keep track of entered contexts. 383 // Used as a stack to keep track of entered contexts.
381 List<Handle<Object> > entered_contexts_; 384 List<Handle<Object> > entered_contexts_;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 #ifdef DEBUG 461 #ifdef DEBUG
459 v8::ImplementationUtilities::ZapHandleRange( 462 v8::ImplementationUtilities::ZapHandleRange(
460 spare_, 463 spare_,
461 &spare_[kHandleBlockSize]); 464 &spare_[kHandleBlockSize]);
462 #endif 465 #endif
463 } 466 }
464 467
465 } } // namespace v8::internal 468 } } // namespace v8::internal
466 469
467 #endif // V8_API_H_ 470 #endif // V8_API_H_
OLDNEW
« no previous file with comments | « no previous file | src/list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698