mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
use memory pool
This commit is contained in:
parent
28b395bef4
commit
2ab0ad24a3
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/chrislusf/seaweedfs/weed/util/mem"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -326,7 +327,8 @@ func ReadUrlAsStream(fileUrl string, cipherKey []byte, isContentGzipped bool, is
|
|||
var (
|
||||
m int
|
||||
)
|
||||
buf := make([]byte, 64*1024)
|
||||
buf := mem.Allocate(64 * 1024)
|
||||
defer mem.Free(buf)
|
||||
|
||||
for {
|
||||
m, err = reader.Read(buf)
|
||||
|
|
Loading…
Reference in a new issue