Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
vm
splay-tree.h
Go to the documentation of this file.
1
// Copyright (c) 2019, 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_SPLAY_TREE_H_
6
#define RUNTIME_VM_SPLAY_TREE_H_
7
8
#include "
platform/splay-tree.h
"
9
#include "
vm/zone.h
"
10
11
namespace
dart
{
12
13
// A zone splay tree. The config type parameter encapsulates the
14
// different configurations of a concrete splay tree (see
15
// platform/splay-tree.h). The tree itself and all its elements are allocated
16
// in the Zone.
17
template
<
typename
Config>
18
class
ZoneSplayTree
final :
public
SplayTree
<Config, ZoneAllocated, Zone> {
19
public
:
20
explicit
ZoneSplayTree
(
Zone
* zone)
21
:
SplayTree
<
Config
,
ZoneAllocated
,
Zone
>(
ASSERT_NOTNULL
(zone)) {}
22
~ZoneSplayTree
() {
23
// Reset the root to avoid unneeded iteration over all tree nodes
24
// in the destructor. For a zone-allocated tree, nodes will be
25
// freed by the Zone.
26
SplayTree<Config, ZoneAllocated, Zone>::ResetRoot
();
27
}
28
};
29
30
}
// namespace dart
31
32
#endif
// RUNTIME_VM_SPLAY_TREE_H_
ASSERT_NOTNULL
#define ASSERT_NOTNULL(ptr)
Definition:
assert.h:323
dart::SplayTree
Definition:
splay-tree.h:29
dart::SplayTree::ResetRoot
void ResetRoot()
Definition:
splay-tree.h:125
dart::ZoneAllocated
Definition:
allocation.h:53
dart::ZoneSplayTree
Definition:
splay-tree.h:18
dart::ZoneSplayTree::ZoneSplayTree
ZoneSplayTree(Zone *zone)
Definition:
splay-tree.h:20
dart::ZoneSplayTree::~ZoneSplayTree
~ZoneSplayTree()
Definition:
splay-tree.h:22
dart::Zone
Definition:
unit_test_custom_zone.h:19
dart
Definition:
dart_vm.cc:33
splay-tree.h
Config
Definition:
nanobench.h:24
zone.h
Generated on Sun Jun 23 2024 21:55:50 for Flutter Engine by
1.9.4