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

Unified Diff: vm/pages.h

Issue 8898034: - Implement the old sweeper. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | « vm/heap_test.cc ('k') | vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/pages.h
===================================================================
--- vm/pages.h (revision 2478)
+++ vm/pages.h (working copy)
@@ -5,6 +5,7 @@
#ifndef VM_PAGES_H_
#define VM_PAGES_H_
+#include "vm/freelist.h"
#include "vm/globals.h"
#include "vm/virtual_memory.h"
@@ -88,15 +89,23 @@
// Collect the garbage in the page space using mark-sweep.
void MarkSweep();
+ static HeapPage* PageFor(RawObject* raw_obj) {
+ return reinterpret_cast<HeapPage*>(
+ RawObject::ToAddr(raw_obj) & ~(kPageSize -1));
+ }
+
private:
static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
void AllocatePage();
HeapPage* AllocateLargePage(intptr_t size);
+ void FreeLargePage(HeapPage* page, HeapPage* previous_page);
void FreePages(HeapPage* pages);
uword TryBumpAllocate(intptr_t size);
+ FreeList freelist_;
+
Heap* heap_;
HeapPage* pages_;
« no previous file with comments | « vm/heap_test.cc ('k') | vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698