- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for GetByteBufferCap (0.12 sec)
-
internal/grid/grid.go
// There is no minimum size. var GetByteBuffer = func() []byte { b := *internalByteBuffer.Get().(*[]byte) 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) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 6.9K bytes - Viewed (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.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Aug 14 17:11:51 UTC 2024 - 15.5K bytes - Viewed (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:
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 09 16:58:30 UTC 2024 - 27.7K bytes - Viewed (0) -
internal/grid/connection.go
if sz := payload.Msgsize(); cap(msg.Payload) < sz { PutByteBuffer(msg.Payload) msg.Payload = GetByteBufferCap(sz) } var err error msg.Payload, err = payload.MarshalMsg(msg.Payload[:0]) msg.Op = payload.Op() if err != nil { return err } } defer PutByteBuffer(msg.Payload) dst := GetByteBufferCap(msg.Msgsize()) dst, err := msg.MarshalMsg(dst) if err != nil { return err }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 46.7K bytes - Viewed (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.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Oct 22 15:30:50 UTC 2024 - 17.3K bytes - Viewed (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++
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 15.9K bytes - Viewed (0) -
cmd/erasure-healing.go
if disk == OfflineDisk { continue } partPath := pathJoin(tmpID, dstDataDir, fmt.Sprintf("part.%d", partNumber)) if len(inlineBuffers) > 0 { buf := grid.GetByteBufferCap(int(erasure.ShardFileSize(latestMeta.Size)) + 64) inlineBuffers[i] = bytes.NewBuffer(buf[:0]) defer grid.PutByteBuffer(buf)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Oct 02 17:50:41 UTC 2024 - 34.4K bytes - Viewed (0) -
cmd/xl-storage-disk-id-check.go
p.storage.setWriteAttribute(p.totalWrites.Add(1)) } done(0, &err) }() // Copy inline data to a new buffer to function with deadlines. if len(fi.Data) > 0 { fi.Data = append(grid.GetByteBufferCap(len(fi.Data))[:0], fi.Data...) } return xioutil.WithDeadline[RenameDataResp](ctx, globalDriveConfig.GetMaxTimeout(), func(ctx context.Context) (res RenameDataResp, err error) { if len(fi.Data) > 0 {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Oct 26 09:56:26 UTC 2024 - 34.5K bytes - Viewed (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)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Oct 31 22:10:24 UTC 2024 - 78.8K bytes - Viewed (0)