[go] cmd/compile/internal/bitvec: use chunked allocation in NewBulk

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Feb 12, 2026, 12:29:12 PM (18 hours ago) Feb 12
to Michael Podtserkovskii, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Junyang Shao, Go LUCI, Keith Randall, Keith Randall, Robert Griesemer, Matthew Dempsky, Martin Möhrmann, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
cmd/compile/internal/bitvec: remove 2GB allocation limit in NewBulk

Remove the "NewBulk too big" check that prevented bulk bit vector
allocations exceeding ~2GB. This limit was overly restrictive and
caused compilation failures for large generated code.

The actual constraint is in the runtime's stackmap reader, which uses
int32 arithmetic. Add overflow checks in cmd/compile/internal/liveness
before stackmap serialization to detect this condition, allowing
NewBulk itself to allocate bulk large bit vector.

Fixes #77170
Change-Id: Ib7f2cabb28683258fc4e85418ba7fa70b48620b0
Reviewed-by: Keith Randall <k...@golang.org>
Auto-Submit: Keith Randall <k...@golang.org>
Reviewed-by: Keith Randall <k...@google.com>
Reviewed-by: Junyang Shao <shaoj...@google.com>
Files:
  • M src/cmd/compile/internal/bitvec/bv.go
  • M src/cmd/compile/internal/liveness/arg.go
  • M src/cmd/compile/internal/liveness/plive.go
Change size: S
Delta: 3 files changed, 27 insertions(+), 7 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Keith Randall, +1 by Junyang Shao, +2 by Keith Randall
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib7f2cabb28683258fc4e85418ba7fa70b48620b0
Gerrit-Change-Number: 736240
Gerrit-PatchSet: 4
Gerrit-Owner: Michael Podtserkovskii <mich...@meta.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Junyang Shao <shaoj...@google.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
Gerrit-Reviewer: Matthew Dempsky <mat...@go.dev>
Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages