summaryrefslogtreecommitdiff
path: root/internal/fastio/noescape/noescape.go
blob: 02d25b587984b5d4d1cbe1e5f053ff1314d477da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2023  Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later

package noescape

import (
	"io"
	_ "unsafe"
)

//go:noescape
//go:linkname Write io.Writer.Write
func Write(w io.Writer, dat []byte) (int, error)

//go:noescape
//go:linkname WriteString io.StringWriter.WriteString
func WriteString(w io.Writer, dat string) (int, error)

//go:noescape
//go:linkname WriteAt io.WriterAt.WriteAt
func WriteAt(w io.WriterAt, dat []byte, off int64) (int, error)

//go:noescape
//go:linkname Read io.Reader.Read
func Read(w io.Reader, dat []byte) (int, error)

//go:noescape
//go:linkname ReadAt io.ReaderAt.ReadAt
func ReadAt(w io.WriterAt, dat []byte, off int64) (int, error)