Flutter Engine
The Flutter Engine
spaces.h
Go to the documentation of this file.
1// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_HEAP_SPACES_H_
6#define RUNTIME_VM_HEAP_SPACES_H_
7
8#include "platform/atomic.h"
9#include "platform/globals.h"
10
11// This file contains utilities shared by old and new space.
12// TODO(koda): Create Space base class with Space::CurrentUsage().
13
14namespace dart {
15
16// Usage statistics for a space/generation at a particular moment in time.
18 public:
23
24 intptr_t CombinedCapacityInWords() const {
26 }
27 intptr_t CombinedUsedInWords() const {
29 }
30};
31
32enum class GCType {
38};
39
40enum class GCReason {
41 kNewSpace, // New space is full.
42 kStoreBuffer, // Store buffer is too big.
43 kPromotion, // Old space limit crossed after a scavenge.
44 kOldSpace, // Old space limit crossed, or old space allocation failed.
45 kFinalize, // Concurrent marking finished.
46 kFull, // Heap::CollectAllGarbage
47 kExternal, // Dart_NewFinalizableHandle Dart_NewWeakPersistentHandle
48 kIdle, // Dart_NotifyIdle
49 kDestroyed, // Dart_NotifyDestroyed
50 kDebugging, // service request, etc.
51 kCatchUp, // End of ForceGrowthScope or Dart_PerformanceMode_Latency.
52};
53
54static constexpr intptr_t kNewAllocatableSize = 256 * KB;
55static constexpr intptr_t kAllocatablePageSize = 64 * KB;
56
57inline bool IsAllocatableInNewSpace(intptr_t size) {
58 return size <= kNewAllocatableSize;
59}
60inline bool IsAllocatableViaFreeLists(intptr_t size) {
62}
63
64} // namespace dart
65
66#endif // RUNTIME_VM_HEAP_SPACES_H_
RelaxedAtomic< intptr_t > external_in_words
Definition: spaces.h:22
intptr_t CombinedUsedInWords() const
Definition: spaces.h:27
RelaxedAtomic< intptr_t > capacity_in_words
Definition: spaces.h:20
intptr_t CombinedCapacityInWords() const
Definition: spaces.h:24
RelaxedAtomic< intptr_t > used_in_words
Definition: spaces.h:21
Definition: dart_vm.cc:33
GCType
Definition: spaces.h:32
constexpr intptr_t KB
Definition: globals.h:528
bool IsAllocatableInNewSpace(intptr_t size)
Definition: spaces.h:57
GCReason
Definition: spaces.h:40
static constexpr intptr_t kAllocatablePageSize
Definition: spaces.h:55
bool IsAllocatableViaFreeLists(intptr_t size)
Definition: spaces.h:60
static constexpr intptr_t kNewAllocatableSize
Definition: spaces.h:54
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259