| Index: runtime/vm/object_id_ring.h
|
| diff --git a/runtime/vm/object_id_ring.h b/runtime/vm/object_id_ring.h
|
| index ee9038d3fe56c59a432a06992e6a844e1a18bd8f..a7acb76c18728a430c77b296d9066f70a4a117cf 100644
|
| --- a/runtime/vm/object_id_ring.h
|
| +++ b/runtime/vm/object_id_ring.h
|
| @@ -19,6 +19,13 @@ class ObjectPointerVisitor;
|
| // ids will be invalidated.
|
| class ObjectIdRing {
|
| public:
|
| + enum LookupResult {
|
| + kValid = 0,
|
| + kInvalid, // Malformed ring id (used in service.cc).
|
| + kCollected, // Entry was reclaimed due to a full GC (entries are weak).
|
| + kExpired, // Entry was evicted during an insertion into a full ring.
|
| + };
|
| +
|
| static const int32_t kMaxId = 0x3FFFFFFF;
|
| static const int32_t kInvalidId = -1;
|
| static const int32_t kDefaultCapacity = 1024;
|
| @@ -27,10 +34,12 @@ class ObjectIdRing {
|
|
|
| ~ObjectIdRing();
|
|
|
| + // Adds the argument to the ring and returns its id. Note we do not allow
|
| + // adding Object::null().
|
| int32_t GetIdForObject(RawObject* raw_obj);
|
|
|
| - // Returns Object::sentinel() when the id is not valid.
|
| - RawObject* GetObjectForId(int32_t id);
|
| + // Returns Object::null() when the result is not kValid.
|
| + RawObject* GetObjectForId(int32_t id, LookupResult* kind);
|
|
|
| void VisitPointers(ObjectPointerVisitor* visitor);
|
|
|
|
|