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

Unified Diff: src/zone.h

Issue 12826: RegExp stack and zone limits. (Closed)
Patch Set: Created 12 years, 1 month 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
« src/parser.cc ('K') | « src/top.cc ('k') | src/zone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone.h
diff --git a/src/zone.h b/src/zone.h
index c7129ec4b06a50500ae5295aad35db3d3e7fc1df..9721b0724b9324e6b9063753b58bb042d426bca3 100644
--- a/src/zone.h
+++ b/src/zone.h
@@ -61,7 +61,13 @@ class Zone {
// Delete all objects and free all memory allocated in the Zone.
static void DeleteAll();
+ // Returns true if more memory has been allocated in zones than
+ // the limit allows.
+ static inline bool excess_allocation();
+
private:
+ friend class Segment;
+
// All pointers returned from New() have this alignment.
static const int kAlignment = kPointerSize;
@@ -71,6 +77,13 @@ class Zone {
// Never keep segments larger than this size in bytes around.
static const int kMaximumKeptSegmentSize = 64 * KB;
+ // Report zone excess when allocation exceeds this limit.
+ static int zone_excess_limit_;
+
+ // The number of bytes allocated in segments. Note that this number
+ // includes memory allocated from the OS but not yet allocated from
+ // the zone.
+ static int segment_bytes_allocated_;
// The Zone is intentionally a singleton; you should not try to
// allocate instances of the class.
« src/parser.cc ('K') | « src/top.cc ('k') | src/zone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698