mirror of
https://github.com/ii64/sonic.git
synced 2026-06-23 01:46:44 +08:00
fix:(encoder) keep arguement buf alive (#166)
This commit is contained in:
parent
1443eb3bcf
commit
fcfe1c4317
3 changed files with 1 additions and 3 deletions
|
|
@ -84,7 +84,6 @@ var _KeepAlive struct {
|
||||||
|
|
||||||
var errCallShadow = errors.New("DON'T CALL THIS!")
|
var errCallShadow = errors.New("DON'T CALL THIS!")
|
||||||
|
|
||||||
//go:nosplit
|
|
||||||
// Faker func of _Decoder, used to export its stackmap as _Decoder's
|
// Faker func of _Decoder, used to export its stackmap as _Decoder's
|
||||||
func _Decoder_Shadow(s string, i int, vp unsafe.Pointer, sb *_Stack, fv uint64, sv string, vk unsafe.Pointer) (ret int, err error) {
|
func _Decoder_Shadow(s string, i int, vp unsafe.Pointer, sb *_Stack, fv uint64, sv string, vk unsafe.Pointer) (ret int, err error) {
|
||||||
// align to assembler_amd64.go: _FP_offs
|
// align to assembler_amd64.go: _FP_offs
|
||||||
|
|
@ -105,7 +104,6 @@ func _Decoder_Shadow(s string, i int, vp unsafe.Pointer, sb *_Stack, fv uint64,
|
||||||
return 0, errCallShadow
|
return 0, errCallShadow
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:nosplit
|
|
||||||
// Faker func of _Decoder_Generic, used to export its stackmap
|
// Faker func of _Decoder_Generic, used to export its stackmap
|
||||||
func _Decoder_Generic_Shadow(sb *_Stack) {
|
func _Decoder_Generic_Shadow(sb *_Stack) {
|
||||||
// align to generic_amd64.go: _VD_offs
|
// align to generic_amd64.go: _VD_offs
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ func EncodeInto(buf *[]byte, val interface{}, opts Options) error {
|
||||||
freeStack(stk)
|
freeStack(stk)
|
||||||
|
|
||||||
/* avoid GC ahead */
|
/* avoid GC ahead */
|
||||||
|
runtime.KeepAlive(buf)
|
||||||
runtime.KeepAlive(efv)
|
runtime.KeepAlive(efv)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,6 @@ var _KeepAlive struct {
|
||||||
var errCallShadow = errors.New("DON'T CALL THIS!")
|
var errCallShadow = errors.New("DON'T CALL THIS!")
|
||||||
|
|
||||||
// Faker func of _Encoder, used to export its stackmap as _Encoder's
|
// Faker func of _Encoder, used to export its stackmap as _Encoder's
|
||||||
//go:nosplit
|
|
||||||
func _Encoder_Shadow(rb *[]byte, vp unsafe.Pointer, sb *_Stack, fv uint64) (err error) {
|
func _Encoder_Shadow(rb *[]byte, vp unsafe.Pointer, sb *_Stack, fv uint64) (err error) {
|
||||||
// align to assembler_amd64.go: _FP_offs
|
// align to assembler_amd64.go: _FP_offs
|
||||||
var frame [_FP_offs]byte
|
var frame [_FP_offs]byte
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue