1 // Copyright ©2015 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 // offset returns the number of float64 values b[0] is after a[0].
12 func offset(a, b []float64) int {
16 // This expression must be atomic with respect to GC moves.
17 // At this stage this is true, because the GC does not
18 // move. See https://golang.org/issue/12445.
19 return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(float64(0)))