Chromium Code Reviews| Index: runtime/vm/heap.h |
| =================================================================== |
| --- runtime/vm/heap.h (revision 22017) |
| +++ runtime/vm/heap.h (working copy) |
| @@ -58,7 +58,7 @@ |
| switch (space) { |
| case kNew: |
| // Do not attempt to allocate very large objects in new space. |
| - if (!PageSpace::IsPageAllocatableSize(size)) { |
| + if (!IsNewAllocatableSize(size)) { |
| return AllocateOld(size, HeapPage::kData); |
| } |
| return AllocateNew(size); |
| @@ -192,6 +192,10 @@ |
| bool gc_in_progress() const { return gc_in_progress_; } |
| + static bool IsNewAllocatableSize(intptr_t size) { |
|
Vyacheslav Egorov (Google)
2013/04/25 22:11:28
the name is a bit confusing. maybe IsAllocatableIn
Ivan Posva
2013/04/26 06:14:00
I was not happy with the name either. I settled on
|
| + return size <= kNewAllocatableSize; |
| + } |
| + |
| private: |
| class GCStats : public ValueObject { |
| public: |
| @@ -224,6 +228,8 @@ |
| DISALLOW_COPY_AND_ASSIGN(GCStats); |
| }; |
| + static const intptr_t kNewAllocatableSize = 256 * KB; |
| + |
| Heap(); |
| uword AllocateNew(intptr_t size); |