mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 10:55:35 +00:00
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:
@@ -41,6 +41,7 @@ func SliceOf(s uintptr) []byte {
|
|||||||
h := (*reflect.SliceHeader)(unsafe.Pointer(&res))
|
h := (*reflect.SliceHeader)(unsafe.Pointer(&res))
|
||||||
h.Data = s
|
h.Data = s
|
||||||
h.Cap = 1 << 30
|
h.Cap = 1 << 30
|
||||||
|
h.Len = 1 << 30
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user