MCPcopy Create free account
hub / github.com/cloudwego/netpoll / Slice

Method Slice

nocopy.go:97–97  ·  view source on GitHub ↗

Slice returns a new Reader containing the Next n bytes from this Reader. If you want to make a new Reader using the []byte returned by Next, Slice already does that, and the operation is zero-copy. Besides, Slice would also Release this Reader. The logic pseudocode is similar: var p, err = this.Ne

(n int)

Source from the content-addressed store, hash-verified

95 // return reader, err
96 //
97 Slice(n int) (r Reader, err error)
98
99 // Release the memory space occupied by all read slices. This method needs to be executed actively to
100 // recycle the memory after confirming that the previously read data is no longer in use.

Callers 10

SliceMethod · 0.65
WriteStringMethod · 0.65
SliceMethod · 0.65
TestLinkBufferReferFunction · 0.65
TestLinkBufferResetTailFunction · 0.65
TestUnsafeStringToSliceFunction · 0.65
SliceMethod · 0.65
EpollWaitFunction · 0.65

Implementers 3

zcReadernocopy_readwriter.go
UnsafeLinkBuffernocopy_linkbuffer.go
connectionconnection_impl.go

Calls

no outgoing calls

Tested by 5

TestLinkBufferReferFunction · 0.52
TestLinkBufferResetTailFunction · 0.52
TestUnsafeStringToSliceFunction · 0.52