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

Unified Diff: src/spaces.h

Issue 4634003: Landing for Justin Schuh.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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
« no previous file with comments | « src/heap.cc ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
===================================================================
--- src/spaces.h (revision 5798)
+++ src/spaces.h (working copy)
@@ -491,8 +491,8 @@
class MemoryAllocator : public AllStatic {
public:
// Initializes its internal bookkeeping structures.
- // Max capacity of the total space.
- static bool Setup(intptr_t max_capacity);
+ // Max capacity of the total space and executable memory limit.
+ static bool Setup(int max_capacity, int capacity_executable);
// Deletes valid chunks.
static void TearDown();
@@ -590,6 +590,12 @@
// Returns allocated spaces in bytes.
static intptr_t Size() { return size_; }
+ // Returns the maximum available executable bytes of heaps.
+ static int AvailableExecutable() {
+ if (capacity_executable_ < size_executable_) return 0;
+ return capacity_executable_ - size_executable_;
+ }
+
// Returns allocated executable spaces in bytes.
static intptr_t SizeExecutable() { return size_executable_; }
@@ -653,6 +659,8 @@
private:
// Maximum space size in bytes.
static intptr_t capacity_;
+ // Maximum subset of capacity_ that can be executable
+ static intptr_t capacity_executable_;
// Allocated space size in bytes.
static intptr_t size_;
« no previous file with comments | « src/heap.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698