internal/unsafe: fix SliceOf to return len equals to cap

Broken by gioui.org/commit/2dce8a0155ae192f54f74747d660b9f311e9e364,
found while debugging the dormant OpenGL backend for Windows.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-01-26 14:48:27 +01:00
parent b11fd6ee8e
commit 57872856e8
+1
View File
@@ -41,6 +41,7 @@ func SliceOf(s uintptr) []byte {
h := (*reflect.SliceHeader)(unsafe.Pointer(&res))
h.Data = s
h.Cap = 1 << 30
h.Len = 1 << 30
return res
}