mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 23:06:30 -05:00
use local stack buffer
This commit is contained in:
parent
f45fa6e918
commit
4aadaa7513
@ -33,7 +33,9 @@ func MarshalCommand(command interface{}, writer io.Writer) error {
|
|||||||
return ErrUnknownCommand
|
return ErrUnknownCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer := alloc.NewSmallBuffer().Clear()
|
buffer := alloc.NewLocalBuffer(512).Clear()
|
||||||
|
defer buffer.Release()
|
||||||
|
|
||||||
err := factory.Marshal(command, buffer)
|
err := factory.Marshal(command, buffer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user