98a2e90d4f
Makes things a bit simpler and avoids the situation where a low external survival rate would trigger excessive GCs because the external allocation threshold would remain low. Bug: https://github.com/dart-lang/sdk/issues/33637 Bug: https://github.com/flutter/flutter/issues/18519 Change-Id: I53b38bd41e6232eaab848c81b2a79f7ec73fab54 Reviewed-on: https://dart-review.googlesource.com/63503 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Zach Anderson <zra@google.com>
32 lines
957 B
C++
32 lines
957 B
C++
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_VM_HEAP_SPACES_H_
|
|
#define RUNTIME_VM_HEAP_SPACES_H_
|
|
|
|
// This file contains utilities shared by old and new space.
|
|
// TODO(koda): Create Space base class with Space::CurrentUsage().
|
|
|
|
namespace dart {
|
|
|
|
// Usage statistics for a space/generation at a particular moment in time.
|
|
class SpaceUsage {
|
|
public:
|
|
SpaceUsage() : capacity_in_words(0), used_in_words(0), external_in_words(0) {}
|
|
intptr_t capacity_in_words;
|
|
intptr_t used_in_words;
|
|
intptr_t external_in_words;
|
|
|
|
intptr_t CombinedCapacityInWords() const {
|
|
return capacity_in_words + external_in_words;
|
|
}
|
|
intptr_t CombinedUsedInWords() const {
|
|
return used_in_words + external_in_words;
|
|
}
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_HEAP_SPACES_H_
|