- Sort Score
- Num 10 results
- Language All
Results 1 - 6 of 6 for GetByteBufferCap (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
internal/grid/grid.go
// There is no minimum size. var GetByteBuffer = func() []byte { b := *internalByteBuffer.Get() return b[:0] } // GetByteBufferCap returns a length 0 byte buffer with at least the given capacity. func GetByteBufferCap(wantSz int) []byte { if wantSz < defaultBufferSize { b := GetByteBuffer()[:0] if cap(b) >= wantSz { return b } PutByteBuffer(b) }
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Mar 30 00:56:02 GMT 2025 - 7K bytes - Click Count (0) -
internal/grid/handlers.go
if c == nil { if h.ignoreNilConn { return resp, nil } return resp, ErrDisconnected } payload, err := req.MarshalMsg(GetByteBufferCap(req.Msgsize())) if err != nil { return resp, err } switch any(req).(type) { case *MSS, *URLValues: ctx = context.WithValue(ctx, TraceParamsKey{}, req) case *NoPayload, *Bytes:Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Tue Feb 18 16:25:55 GMT 2025 - 27.7K bytes - Click Count (0) -
internal/grid/types.go
func NewBytes() *Bytes { b := Bytes(GetByteBuffer()[:0]) return &b } // NewBytesCap returns an empty Bytes with the given capacity. func NewBytesCap(size int) *Bytes { b := Bytes(GetByteBufferCap(size)) return &b } // NewBytesWith returns a new Bytes with the provided content. // When sent as a parameter, the caller gives up ownership of the byte slice.
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 15.5K bytes - Click Count (0) -
cmd/storage-datatypes.go
type RenameDataInlineHandlerParams struct { RenameDataHandlerParams `msg:"p"` } func newRenameDataInlineHandlerParams() *RenameDataInlineHandlerParams { buf := grid.GetByteBufferCap(32 + 16<<10) return &RenameDataInlineHandlerParams{RenameDataHandlerParams{FI: FileInfo{Data: buf[:0]}}} } // Recycle will reuse the memory allocated for the FileInfo data.Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 17.4K bytes - Click Count (0) -
internal/grid/muxclient.go
} return m.sendLocked(msg) } // sendLocked the message. msg.Seq and msg.MuxID will be set. // m.respMu must be held. func (m *muxClient) sendLocked(msg message) error { dst := GetByteBufferCap(msg.Msgsize()) msg.Seq = m.SendSeq msg.MuxID = m.MuxID msg.Flags |= m.BaseFlags if debugPrint { fmt.Println("Client sending", &msg, "to", m.parent.Remote) } m.SendSeq++
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 15.9K bytes - Click Count (0) -
cmd/erasure-object.go
inlineBuffers := make([]*bytes.Buffer, len(onlineDisks)) for i, disk := range onlineDisks { if disk == nil { continue } if disk.IsOnline() { buf := grid.GetByteBufferCap(int(erasure.ShardFileSize(data.Size())) + 64) inlineBuffers[i] = bytes.NewBuffer(buf[:0]) defer grid.PutByteBuffer(buf)
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Oct 24 04:05:31 GMT 2025 - 80.4K bytes - Click Count (0)