diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-18 01:45:49 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-18 01:45:49 +0000 |
commit | 2d9dc3c1b7be34442f224a10013dd5f3823c962a (patch) | |
tree | e25228b2da4ae13353eb247d3771352a182fb41e /pkg/safemem/seq_unsafe.go | |
parent | 45be62df210badd412752214925e0de28887ed54 (diff) | |
parent | f051ec64639b83faabcfe766ff078072def3c2aa (diff) |
Merge release-20210208.0-64-gf051ec646 (automated)
Diffstat (limited to 'pkg/safemem/seq_unsafe.go')
-rw-r--r-- | pkg/safemem/seq_unsafe.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/safemem/seq_unsafe.go b/pkg/safemem/seq_unsafe.go index fc4049eeb..b315b0e5a 100644 --- a/pkg/safemem/seq_unsafe.go +++ b/pkg/safemem/seq_unsafe.go @@ -17,9 +17,10 @@ package safemem import ( "bytes" "fmt" - "reflect" "syscall" "unsafe" + + "gvisor.dev/gvisor/pkg/gohacks" ) // A BlockSeq represents a sequence of Blocks, each of which has non-zero @@ -184,8 +185,8 @@ func (bs BlockSeq) Tail() BlockSeq { return BlockSeq{} } var extSlice []Block - extSliceHdr := (*reflect.SliceHeader)(unsafe.Pointer(&extSlice)) - extSliceHdr.Data = uintptr(bs.data) + extSliceHdr := (*gohacks.SliceHeader)(unsafe.Pointer(&extSlice)) + extSliceHdr.Data = bs.data extSliceHdr.Len = bs.length extSliceHdr.Cap = bs.length tailSlice := skipEmpty(extSlice[1:]) |