#include <object_id_ring.h>
Definition at line 22 of file object_id_ring.h.
◆ IdPolicy
Enumerator |
---|
kAllocateId | |
kReuseId | |
kNumIdPolicy | |
Definition at line 31 of file object_id_ring.h.
◆ LookupResult
Enumerator |
---|
kValid | |
kInvalid | |
kCollected | |
kExpired | |
Definition at line 24 of file object_id_ring.h.
◆ ObjectIdRing()
dart::ObjectIdRing::ObjectIdRing |
( |
| ) |
|
Definition at line 89 of file object_id_ring.cc.
89 {
90 serial_num_ = 0;
91 wrapped_ = false;
92 table_ = nullptr;
94}
static constexpr int32_t kDefaultCapacity
static constexpr int32_t kMaxId
◆ ~ObjectIdRing()
dart::ObjectIdRing::~ObjectIdRing |
( |
| ) |
|
Definition at line 15 of file object_id_ring.cc.
15 {
17 free(table_);
18 table_ = nullptr;
19}
◆ GetIdForObject()
Definition at line 21 of file object_id_ring.cc.
21 {
22
23
26 return AllocateNewId(object);
27 }
29 int32_t id = FindExistingIdForObject(object);
31
33 }
34 return AllocateNewId(object);
35}
static constexpr int32_t kInvalidId
◆ GetObjectForId()
Definition at line 46 of file object_id_ring.cc.
46 {
47 int32_t index = IndexOfId(id);
51 }
57 }
59 ASSERT(IdOfIndex(index) ==
id);
60 return table_[index];
61}
◆ PrintJSON()
void dart::ObjectIdRing::PrintJSON |
( |
JSONStream * |
js | ) |
|
Definition at line 68 of file object_id_ring.cc.
68 {
70 Zone* zone = thread->zone();
72 JSONObject jsobj(js);
73 jsobj.AddProperty("type", "_IdZone");
74 jsobj.AddProperty("name", "default");
75 {
76 JSONArray objects(&jsobj, "objects");
78 for (int32_t i = 0; i < capacity_; i++) {
79 obj = table_[i];
80 if (obj.IsNull()) {
81
82 continue;
83 }
84 objects.AddValue(obj, false);
85 }
86 }
87}
static Thread * Current()
◆ VisitPointers()
Definition at line 63 of file object_id_ring.cc.
63 {
65 visitor->VisitPointers(table_, capacity_);
66}
◆ ObjectIdRingTestHelper
◆ kDefaultCapacity
constexpr int32_t dart::ObjectIdRing::kDefaultCapacity = 8192 |
|
staticconstexpr |
◆ kInvalidId
constexpr int32_t dart::ObjectIdRing::kInvalidId = -1 |
|
staticconstexpr |
◆ kMaxId
constexpr int32_t dart::ObjectIdRing::kMaxId = 0x3FFFFFFF |
|
staticconstexpr |
The documentation for this class was generated from the following files: