[S] Change in dart/sdk[main]: [vm/service]: reuse deleted ID zone slots to bound array growth (#62205)

0 views
Skip to first unread message

Nourhan Hasan (Gerrit)

unread,
Mar 22, 2026, 12:09:43 PM (8 days ago) Mar 22
to Liam Appelbe, vm-...@dartlang.org, rev...@dartlang.org
Attention needed from Liam Appelbe

Nourhan Hasan has uploaded the change for review

Nourhan Hasan would like Liam Appelbe to review this change.

Commit message

[vm/service]: reuse deleted ID zone slots to bound array growth (#62205)

Adds a free list for indices, preventing unbounded
array growth on repeated create/delete cycles.

R=li...@google.com
Change-Id: I0bbec4a0fc0aef9ed8679a3aa5ce832fea9bfde8

Change information

Files:
  • M runtime/vm/isolate.cc
  • M runtime/vm/isolate.h
Change size: S
Delta: 2 files changed, 25 insertions(+), 3 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Liam Appelbe
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: newchange
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I0bbec4a0fc0aef9ed8679a3aa5ce832fea9bfde8
Gerrit-Change-Number: 489720
Gerrit-PatchSet: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Liam Appelbe <li...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Liam Appelbe <li...@google.com>
unsatisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
Mar 22, 2026, 12:13:29 PM (8 days ago) Mar 22
to Liam Appelbe, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Liam Appelbe

Nourhan Hasan added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Nourhan Hasan . resolved

I created a second array (free_service_id_zone_slots_) that tracks which indices in service_id_zones_ are empty and available for reuse.

Open in Gerrit

Related details

Attention is currently required from:
  • Liam Appelbe
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: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Liam Appelbe <li...@google.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Liam Appelbe <li...@google.com>
Gerrit-Comment-Date: Sun, 22 Mar 2026 16:13:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Liam Appelbe (Gerrit)

unread,
Mar 22, 2026, 7:34:32 PM (8 days ago) Mar 22
to Nourhan Hasan, Ryan Macnak, rev...@dartlang.org, vm-...@dartlang.org, Liam Appelbe
Attention needed from Nourhan Hasan and Ryan Macnak

Liam Appelbe added 1 comment

Patchset-level comments
Liam Appelbe . resolved

Ryan has more context about this issue than me.

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
  • 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: 1
Gerrit-Owner: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Reviewer: Ryan Macnak <rma...@google.com>
Gerrit-Attention: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Sun, 22 Mar 2026 23:34:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Mar 24, 2026, 1:32:30 PM (6 days ago) Mar 24
to Nourhan Hasan, Ryan Macnak, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Nourhan Hasan and Ryan Macnak

Ben Konyi added 1 comment

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

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.

Open in Gerrit

Related details

Attention is currently required from:
  • Nourhan Hasan
  • 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: 1
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: Nourhan Hasan <nourhan...@gmail.com>
Gerrit-Attention: Ryan Macnak <rma...@google.com>
Gerrit-Comment-Date: Tue, 24 Mar 2026 17:32:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

unread,
Mar 26, 2026, 2:13:56 PM (4 days ago) Mar 26
to Ben Konyi, Ryan Macnak, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Ryan Macnak

Nourhan Hasan added 1 comment

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

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.

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: 1
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: Thu, 26 Mar 2026 18:13:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Ben Konyi <bko...@google.com>
unsatisfied_requirement
open
diffy

Nourhan Hasan (Gerrit)

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

Nourhan Hasan removed Liam Appelbe from this change

Deleted Reviewers:
  • Liam Appelbe
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: deleteReviewer
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I0bbec4a0fc0aef9ed8679a3aa5ce832fea9bfde8
Gerrit-Change-Number: 489720
Gerrit-PatchSet: 2
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages