diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-16 22:56:11 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-16 22:56:11 -0700 |
commit | 6f8e7db1ac5ddd21b8e3fcc39a1e30fde9b62c3a (patch) | |
tree | 8f0247b646291577f54f7d164b7fed675388c72c /internal/fastio/noescape/noescape.go | |
parent | debef01cc500fb9368e1d6d0206a32ca358a8c98 (diff) | |
parent | 0d23080e1f2af81d8d4656c3b72791b26f52f361 (diff) |
Merge branch 'lukeshu/perf'
Diffstat (limited to 'internal/fastio/noescape/noescape.go')
-rw-r--r-- | internal/fastio/noescape/noescape.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/fastio/noescape/noescape.go b/internal/fastio/noescape/noescape.go new file mode 100644 index 0000000..02d25b5 --- /dev/null +++ b/internal/fastio/noescape/noescape.go @@ -0,0 +1,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) |