]> Cypherpunks repositories - gostls13.git/commit
[release-branch.r60] runtime: fix map memory leak
authorRuss Cox <rsc@golang.org>
Mon, 3 Oct 2011 17:34:24 +0000 (13:34 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 3 Oct 2011 17:34:24 +0000 (13:34 -0400)
commitaf68419ab264f48275563674729109d551185355
tree56b58fb26adf9e3a0122f78e6b0bdd8139ee2591
parent4af7136fcf874e212d66c72178a68db969918b25
[release-branch.r60] runtime: fix map memory leak

««« CL 5158045 / aaf8ddb0c780
runtime: fix map memory leak

The map implementation was using the C idiom of using
a pointer just past the end of its table as a limit pointer.
Unfortunately, the garbage collector sees that pointer as
pointing at the block adjacent to the map table, pinning
in memory a block that would otherwise be freed.

Fix by making limit pointer point at last valid entry, not
just past it.

Reviewed by Mike Burrows.

R=golang-dev, bradfitz, lvd, r
CC=golang-dev
https://golang.org/cl/5158045
»»»

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5169047
src/cmd/ld/dwarf.c
src/pkg/runtime/hashmap.c
src/pkg/runtime/hashmap.h
src/pkg/runtime/runtime-gdb.py