cubefs
30 строк · 913.0 Байт
1// Copyright 2020 The Go 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.
4
5// Package unsafeheader contains header declarations for the Go runtime's
6// slice and string implementations.
7//
8// This package allows x/sys to use types equivalent to
9// reflect.SliceHeader and reflect.StringHeader without introducing
10// a dependency on the (relatively heavy) "reflect" package.
11package unsafeheader12
13import (14"unsafe"15)
16
17// Slice is the runtime representation of a slice.
18// It cannot be used safely or portably and its representation may change in a later release.
19type Slice struct {20Data unsafe.Pointer21Len int22Cap int23}
24
25// String is the runtime representation of a string.
26// It cannot be used safely or portably and its representation may change in a later release.
27type String struct {28Data unsafe.Pointer29Len int30}
31