[M] Change in dart/sdk[main]: [vm/service]: use a map for service ID zones to avoid ID reuse and un...

0 views
Skip to first unread message

Nourhan Hasan (Gerrit)

unread,
Mar 28, 2026, 8:36:13 AM (3 days ago) Mar 28
to Ben Konyi, Ryan Macnak, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Ryan Macnak

Nourhan Hasan voted and added 1 comment

Votes added by Nourhan Hasan

Auto-Submit+1

1 comment

File runtime/vm/isolate.cc
Line 3094, Patchset 1: const intptr_t zone_id = free_service_id_zone_slots_->Last();
Ben Konyi . resolved

I don't think this is the right solution here, mainly because reusing IDs makes it easier for clients to accidentally delete ID zones using an old ID when the zone has already been reused.

The right solution would be to use a map of ID zone IDs -> ID zones instead of a growable array so that we can remove entries as zones are cleaned up.

Nourhan Hasan

Thanks for the feedback. I hadn't considered this case. I chose the free list approach because it requires minimal changes and retains O(1) operations while keeping the array size bounded. However, I agree that using the map would be safer and more effective, but it would require more changes, I think, so I'll see how I can implement that.

Nourhan Hasan

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Ryan Macnak
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I0bbec4a0fc0aef9ed8679a3aa5ce832fea9bfde8
Gerrit-Change-Number: 489720
Gerrit-PatchSet: 4
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-CC: Ben Konyi <bko...@google.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Sat, 28 Mar 2026 12:36:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nourhan Hasan <nourhan...@gmail.com>
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages