• Austin Clements's avatar
    [dev.garbage] runtime: fix nfree accounting · d97625ae
    Austin Clements authored
    Commit 8dda1c4c changed the meaning of "nfree" in sweep from the number
    of newly freed objects to the total number of free objects in the
    span, but didn't update where sweep added nfree to c.local_nsmallfree.
    Hence, we're over-accounting the number of frees. This is causing
    TestArrayHash to fail with "too many allocs NNN - hash not balanced".
    
    Fix this by computing the number of newly freed objects and adding
    that to c.local_nsmallfree, so it behaves like it used to. Computing
    this requires a small tweak to mallocgc: apparently we've never set
    s.allocCount when allocating a large object; fix this by setting it to
    1 so sweep doesn't get confused.
    
    Change-Id: I31902ffd310110da4ffd807c5c06f1117b872dc8
    Reviewed-on: https://go-review.googlesource.com/22595Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    Run-TryBot: Austin Clements <austin@google.com>
    d97625ae
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
dev.garbage Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...