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

Unified Diff: src/zone.cc

Issue 2493002: - Remove [static] from methods in Zone and associated helpers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/zone.cc
===================================================================
--- src/zone.cc (revision 4781)
+++ src/zone.cc (working copy)
@@ -34,15 +34,22 @@
namespace internal {
-Address Zone::position_ = 0;
-Address Zone::limit_ = 0;
-int Zone::zone_excess_limit_ = 256 * MB;
-int Zone::segment_bytes_allocated_ = 0;
+int ZoneScope::nesting_ = 0;
-bool AssertNoZoneAllocation::allow_allocation_ = true;
+Zone::Zone()
+ : zone_excess_limit_(256 * MB),
+ segment_bytes_allocated_(0),
+ position_(0),
+ limit_(0) {
+}
-int ZoneScope::nesting_ = 0;
+ZoneScope::~ZoneScope() {
+ if (ShouldDeleteOnExit()) ZONE->DeleteAll();
+ --nesting_;
+}
+
+
// Segments represent chunks of memory: They have starting address
// (encoded in the this pointer) and a size in bytes. Segments are
// chained together forming a LIFO structure with the newest segment
@@ -67,7 +74,7 @@
// of the segment chain. Returns the new segment.
static Segment* New(int size) {
Segment* result = reinterpret_cast<Segment*>(Malloced::New(size));
- Zone::adjust_segment_bytes_allocated(size);
+ ZONE->adjust_segment_bytes_allocated(size);
if (result != NULL) {
result->next_ = head_;
result->size_ = size;
@@ -78,7 +85,7 @@
// Deletes the given segment. Does not touch the segment chain.
static void Delete(Segment* segment, int size) {
- Zone::adjust_segment_bytes_allocated(-size);
+ ZONE->adjust_segment_bytes_allocated(-size);
Malloced::Delete(segment);
}

Powered by Google App Engine
This is Rietveld 408576698