Loading...
Searching...
No Matches
ephemeron-pair.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_CPPGC_EPHEMERON_PAIR_H_
6#define INCLUDE_CPPGC_EPHEMERON_PAIR_H_
7
9#include "cppgc/member.h"
10
11namespace cppgc {
12
17template <typename K, typename V>
19 EphemeronPair(K* k, V* v) : key(k), value(v) {}
22
24 if (!broker.IsHeapObjectAlive(key)) value = nullptr;
25 }
26};
27
28} // namespace cppgc
29
30#endif // INCLUDE_CPPGC_EPHEMERON_PAIR_H_
Definition: liveness-broker.h:44
bool IsHeapObjectAlive(const T *object) const
Definition: liveness-broker.h:47
Definition: member.h:77
Definition: allocation.h:38
Definition: ephemeron-pair.h:18
EphemeronPair(K *k, V *v)
Definition: ephemeron-pair.h:19
WeakMember< K > key
Definition: ephemeron-pair.h:20
void ClearValueIfKeyIsDead(const LivenessBroker &broker)
Definition: ephemeron-pair.h:23
Member< V > value
Definition: ephemeron-pair.h:21
#define V(Name)