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

Unified Diff: runtime/vm/pages.h

Issue 247793004: RingBuffer<T, N> utility with unit test; use for GC history. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
===================================================================
--- runtime/vm/pages.h (revision 35210)
+++ runtime/vm/pages.h (working copy)
@@ -7,6 +7,7 @@
#include "vm/freelist.h"
#include "vm/globals.h"
+#include "vm/ring_buffer.h"
#include "vm/spaces.h"
#include "vm/virtual_memory.h"
@@ -88,7 +89,7 @@
// runs.
class PageSpaceGarbageCollectionHistory {
public:
- PageSpaceGarbageCollectionHistory();
+ PageSpaceGarbageCollectionHistory() {}
~PageSpaceGarbageCollectionHistory() {}
void AddGarbageCollectionTime(int64_t start, int64_t end);
@@ -96,10 +97,12 @@
int GarbageCollectionTimeFraction();
private:
+ struct Entry {
+ int64_t start;
+ int64_t end;
+ };
static const intptr_t kHistoryLength = 4;
- int64_t start_[kHistoryLength];
- int64_t end_[kHistoryLength];
- intptr_t index_;
+ RingBuffer<Entry, kHistoryLength> history_;
DISALLOW_ALLOCATION();
DISALLOW_COPY_AND_ASSIGN(PageSpaceGarbageCollectionHistory);
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698