git.lukeshu.com/go/lowmemjson@v0.3.9-0.20230723050957-72f6d13f6fb2/internal/fastio/noescape/noescape.go (about)

     1  // Copyright (C) 2023  Luke Shumaker <lukeshu@lukeshu.com>
     2  //
     3  // SPDX-License-Identifier: GPL-2.0-or-later
     4  
     5  package noescape
     6  
     7  import (
     8  	"io"
     9  	_ "unsafe"
    10  )
    11  
    12  //go:noescape
    13  //go:linkname Write io.Writer.Write
    14  func Write(w io.Writer, dat []byte) (int, error)
    15  
    16  //go:noescape
    17  //go:linkname WriteString io.StringWriter.WriteString
    18  func WriteString(w io.Writer, dat string) (int, error)
    19  
    20  //go:noescape
    21  //go:linkname WriteAt io.WriterAt.WriteAt
    22  func WriteAt(w io.WriterAt, dat []byte, off int64) (int, error)
    23  
    24  //go:noescape
    25  //go:linkname Read io.Reader.Read
    26  func Read(w io.Reader, dat []byte) (int, error)
    27  
    28  //go:noescape
    29  //go:linkname ReadAt io.ReaderAt.ReadAt
    30  func ReadAt(w io.WriterAt, dat []byte, off int64) (int, error)