Commit 6609baf2 authored by Keith Randall's avatar Keith Randall Committed by Russ Cox
Browse files

[release-branch.go1.4] runtime: hashmap: move overflow pointer to end of bucket

Pointers to zero-sized values may end up pointing to the next
object in memory, and possibly off the end of a span.  This
can cause memory leaks and/or confuse the garbage collector.

By putting the overflow pointer at the end of the bucket, we
make sure that pointers to any zero-sized keys or values don't
accidentally point to the next object in memory.

fixes #9384

Change-Id: I5d434df176984cb0210b4d0195dd106d6eb28f73
Reviewed-on: https://go-review.googlesource.com/1869


Reviewed-by: default avatarRuss Cox <rsc@golang.org>
(cherry picked from commit fbc56cf0)
Reviewed-on: https://go-review.googlesource.com/2801


Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
parent 957ed90d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment