Re: [libgo] Fix alignment issue in persistent allocator

2019-02-27 Thread Ian Lance Taylor
On Sat, Feb 16, 2019 at 8:26 AM Eric Botcazou  wrote:
>
> This gets rid of a bunch of Go failures on SPARC.
>
> Tested on x86-64/Linux, SPARC/Solaris and SPARC64/Linux.
>
>
> 2019-02-16  Eric Botcazou  
>
> * go/runtime/malloc.go (persistentalloc1): Always align the offset.

Thanks, committed to mainline.  Also sent upstream as
https://golang.org/cl/163859.

Ian


[libgo] Fix alignment issue in persistent allocator

2019-02-16 Thread Eric Botcazou
This gets rid of a bunch of Go failures on SPARC.

Tested on x86-64/Linux, SPARC/Solaris and SPARC64/Linux.


2019-02-16  Eric Botcazou  

* go/runtime/malloc.go (persistentalloc1): Always align the offset.

-- 
Eric BotcazouIndex: go/runtime/malloc.go
===
--- go/runtime/malloc.go	(revision 268849)
+++ go/runtime/malloc.go	(working copy)
@@ -1269,7 +1269,7 @@ func persistentalloc1(size, align uintpt
 break
 			}
 		}
-		persistent.off = sys.PtrSize
+		persistent.off = round(sys.PtrSize, align)
 	}
 	p := persistent.base.add(persistent.off)
 	persistent.off += size