use local stack buffer

pull/215/head
v2ray 2016-07-16 13:22:18 +02:00
parent f45fa6e918
commit 4aadaa7513
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 1 deletions

View File

@ -33,7 +33,9 @@ func MarshalCommand(command interface{}, writer io.Writer) error {
return ErrUnknownCommand
}
buffer := alloc.NewSmallBuffer().Clear()
buffer := alloc.NewLocalBuffer(512).Clear()
defer buffer.Release()
err := factory.Marshal(command, buffer)
if err != nil {
return err