- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for PutByteBuffer (0.14 sec)
-
internal/grid/grid.go
if cap(b) >= wantSz { return b } PutByteBuffer(b) } if wantSz <= maxBufferSize { b := *internal32KByteBuffer.Get().(*[]byte) if cap(b) >= wantSz { return b[:0] } internal32KByteBuffer.Put(&b) } return make([]byte, 0, wantSz) } // PutByteBuffer is for returning byte buffers. var PutByteBuffer = func(b []byte) { if cap(b) >= biggerBufMin && cap(b) < biggerBufMax {
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/connection.go
if payload != nil { 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)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 46.7K bytes - Viewed (0) -
internal/grid/handlers.go
req := h.NewRequest() _, err := req.UnmarshalMsg(payload) if err != nil { PutByteBuffer(payload) r := RemoteErr(err.Error()) return nil, &r } resp, rerr := handle(req) h.recycleReq(req) if rerr != nil { PutByteBuffer(payload) return nil, rerr } payload, err = resp.MarshalMsg(payload[:0]) if !h.sharedResp { h.PutResponse(resp)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 09 16:58:30 UTC 2024 - 27.7K bytes - Viewed (0) -
cmd/listen-notification-handlers.go
if err := enc.Encode(tmpEvt); err != nil { bugLogIf(ctx, err, "event: Encode failed") continue } mergeCh <- append(grid.GetByteBuffer()[:0], buf.Bytes()...) case <-ctx.Done(): grid.PutByteBuffer(buf.Bytes()) return } } }() peers, _ := newPeerRestClients(globalEndpoints) err := globalHTTPListen.Subscribe(mask, localCh, ctx.Done(), func(ev event.Event) bool {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 6K bytes - Viewed (0) -
internal/grid/types.go
if b == nil { return bytes, errors.New("Bytes: UnmarshalMsg on nil pointer") } if bytes, err := msgp.ReadNilBytes(bytes); err == nil { if *b != nil { PutByteBuffer(*b) } *b = nil return bytes, nil } val, bytes, err := msgp.ReadBytesZC(bytes) if err != nil { return bytes, err } if cap(*b) >= len(val) { *b = (*b)[:len(val)]
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/benchmark_test.go
// Create n managers. for _, remote := range grid.Managers { // Register a single handler which echos the payload. errFatal(remote.RegisterSingleHandler(handlerTest, func(payload []byte) ([]byte, *RemoteErr) { defer PutByteBuffer(payload) return append(GetByteBuffer()[:0], payload...), nil })) errFatal(rpc.Register(remote, func(req *testRequest) (resp *testResponse, err *RemoteErr) { return &testResponse{ OrgNum: req.Num,
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 15.7K bytes - Viewed (0) -
internal/grid/muxclient.go
msg.setZeroPayloadFlag() err := m.send(msg) PutByteBuffer(req) if err != nil { m.addErrorNonBlockingClose(errResp, err) errState = true continue } msg.Seq++ } } if errState { // Drain requests. for { select { case r, ok := <-requests: if !ok { return } PutByteBuffer(r) default: return } } }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 15.9K bytes - Viewed (0) -
internal/grid/msg.go
m.Payload = GetByteBuffer()[:0] } h, err := m.UnmarshalMsg(b) if err != nil { return nil, nil, fmt.Errorf("read write: %v", err) } if len(m.Payload) == 0 && m.Flags&FlagPayloadIsZero == 0 { PutByteBuffer(m.Payload) m.Payload = nil } if m.Flags&FlagCRCxxh3 != 0 { const hashLen = 4 if len(h) < hashLen { return nil, nil, fmt.Errorf("want crc len 4, got %v", len(h)) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jul 25 21:07:21 UTC 2024 - 7.6K bytes - Viewed (0) -
cmd/storage-datatypes.go
} // Recycle will reuse the memory allocated for the FileInfo data. func (r *RenameDataInlineHandlerParams) Recycle() { if r == nil { return } if cap(r.FI.Data) >= xioutil.SmallBlock { grid.PutByteBuffer(r.FI.Data) r.FI.Data = nil } } // RenameFileHandlerParams are parameters for RenameFileHandler. type RenameFileHandlerParams struct { DiskID string `msg:"id"` SrcVolume string `msg:"sv"`
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Oct 22 15:30:50 UTC 2024 - 17.3K bytes - Viewed (0) -
cmd/peer-rest-client.go
if err != nil { return } st.Results(func(b []byte) error { select { case traceCh <- b: default: // Do not block on slow receivers. // Just recycle the buffer. grid.PutByteBuffer(b) } return nil }) } func (client *peerRESTClient) doListen(ctx context.Context, listenCh chan<- []byte, v url.Values) { conn := client.gridConn() if conn == nil { return }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 09 16:58:30 UTC 2024 - 26.1K bytes - Viewed (0)