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

Unified Diff: src/heap.h

Issue 70233010: API: Change AdjustAmountOfExternalAllocatedMemory calls to use int64_t instead of intptr_t (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« include/v8.h ('K') | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 7e2eda2529cdd42e2eed94127c5421f46f0c019b..cbe9805929b51c7096f8e408e6f64b2674f79326 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1497,8 +1497,8 @@ class Heap {
// Adjusts the amount of registered external memory.
// Returns the adjusted value.
- inline intptr_t AdjustAmountOfExternalAllocatedMemory(
- intptr_t change_in_bytes);
+ inline int64_t AdjustAmountOfExternalAllocatedMemory(
+ int64_t change_in_bytes);
// This is only needed for testing high promotion mode.
void SetNewSpaceHighPromotionModeActive(bool mode) {
@@ -1517,7 +1517,10 @@ class Heap {
}
inline intptr_t PromotedTotalSize() {
- return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
+ int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
+ if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt);
+ if (total < 0) return 0;
+ return static_cast<intptr_t>(total);
}
inline intptr_t OldGenerationSpaceAvailable() {
@@ -1930,7 +1933,7 @@ class Heap {
int gc_post_processing_depth_;
// Returns the amount of external memory registered since last global gc.
- intptr_t PromotedExternalMemorySize();
+ int64_t PromotedExternalMemorySize();
unsigned int ms_count_; // how many mark-sweep collections happened
unsigned int gc_count_; // how many gc happened
@@ -1984,10 +1987,10 @@ class Heap {
// The amount of external memory registered through the API kept alive
// by global handles
- intptr_t amount_of_external_allocated_memory_;
+ int64_t amount_of_external_allocated_memory_;
// Caches the amount of external memory registered at the last global gc.
- intptr_t amount_of_external_allocated_memory_at_last_global_gc_;
+ int64_t amount_of_external_allocated_memory_at_last_global_gc_;
// Indicates that an allocation has failed in the old generation since the
// last GC.
« include/v8.h ('K') | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698