diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-15 15:05:23 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-02-16 22:56:05 -0700 |
commit | a0e44530509d3b342b8011ac4467d957350f5ffa (patch) | |
tree | c36226f7d3c043b63a8f08f1d3b224ddf89f6844 /internal/base64dec/base64.go | |
parent | 921eeab75a87d07eaf9cec57dcdc8a3c276f291a (diff) |
Avoid io.Writer causing buffers to escape to the heap
Diffstat (limited to 'internal/base64dec/base64.go')
-rw-r--r-- | internal/base64dec/base64.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/base64dec/base64.go b/internal/base64dec/base64.go index dcb4b1c..0d278ad 100644 --- a/internal/base64dec/base64.go +++ b/internal/base64dec/base64.go @@ -10,6 +10,7 @@ import ( "strings" "git.lukeshu.com/go/lowmemjson/internal/fastio" + "git.lukeshu.com/go/lowmemjson/internal/fastio/noescape" ) type base64Decoder struct { @@ -84,7 +85,7 @@ func (dec *base64Decoder) decodeTuple(a, b, c, d byte) error { decoded[1] = byte(val >> 8) decoded[2] = byte(val >> 0) - _, err := dec.dst.Write(decoded[:decodedLen]) + _, err := noescape.Write(dec.dst, decoded[:decodedLen]) return err } |