]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: restore amd64p32 hack for bucket size
authorDmitry Vyukov <dvyukov@google.com>
Thu, 12 Feb 2015 19:31:27 +0000 (22:31 +0300)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 13 Feb 2015 07:02:54 +0000 (07:02 +0000)
This was accidentially removed in:
https://go-review.googlesource.com/#/c/3508/8/src/cmd/gc/reflect.c

Change-Id: I06dd5bb0cb3e2811bd4ef605d7a5225cfa033fe0
Reviewed-on: https://go-review.googlesource.com/4731
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/gc/reflect.c

index 852485d13ea0c313092aa81aa60e1c556f7cdec5..7f81e676f988919172cc5f067d4699562f54a2fb 100644 (file)
@@ -173,6 +173,11 @@ mapbucket(Type *t)
        field[nelem(field)-1]->down = T;
        dowidth(bucket);
 
+       // Pad to the native integer alignment.
+       // This is usually the same as widthptr; the exception (as usual) is amd64p32.
+       if(widthreg > widthptr)
+               bucket->width += widthreg - widthptr;
+
        // See comment on hmap.overflow in ../../runtime/hashmap.go.
        if(!haspointers(t->type) && !haspointers(t->down))
                bucket->haspointers = 1;  // no pointers