Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 69bf17c33e5c901609e76e4af509c970cac5aab5..539bd410b1cf06c2063861c9a442605525d527c4 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -5238,6 +5238,7 @@ enum GCCallbackFlags { |
| kGCCallbackFlagForced = 1 << 2, |
| kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3, |
| kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4, |
| + kGCCallbackFlagCollectAllExternalMemory = 1 << 5, |
| }; |
| typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); |
| @@ -8794,11 +8795,14 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory( |
| typedef internal::Internals I; |
| int64_t* external_memory = reinterpret_cast<int64_t*>( |
| reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset); |
| - const int64_t external_memory_limit = *reinterpret_cast<int64_t*>( |
| + int64_t* external_memory_limit = reinterpret_cast<int64_t*>( |
| reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryLimitOffset); |
| const int64_t amount = *external_memory + change_in_bytes; |
| *external_memory = amount; |
| - if (change_in_bytes > 0 && amount > external_memory_limit) { |
| + if (amount + 192 * 1024 * 1024 < *external_memory_limit) { |
|
Michael Lippautz
2016/08/12 07:06:23
Can we avoid polluting the API and instead adjust
|
| + *external_memory_limit = amount + 192 * 1024 * 1024; |
|
Hannes Payer (out of office)
2016/08/12 14:06:09
Why are you shrinking the limit here?
|
| + } |
| + if (change_in_bytes > 0 && amount > *external_memory_limit) { |
| ReportExternalAllocationLimitReached(); |
| } |
| return *external_memory; |