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

Method WriteString

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

WriteString is a faster implementation of Malloc when a string needs to be written. It replaces: var buf, err = Malloc(len(s)) n = copy(buf, s) return n, err The argument string s will be referenced based on the original address and will not be copied, so make sure that the string s will not be ch

(s string)

Source from the content-addressed store, hash-verified

136 // The argument string s will be referenced based on the original address and will not be copied,
137 // so make sure that the string s will not be changed.
138 WriteString(s string) (n int, err error)
139
140 // WriteBinary is a faster implementation of Malloc when a slice needs to be written.
141 // It replaces:

Callers 8

WriteStringMethod · 0.65
TestOnConnectFunction · 0.65
TestOnDisconnectFunction · 0.65
WriteStringMethod · 0.65
WriteStringMethod · 0.65
TestNewFDConnectionFunction · 0.65

Implementers 4

zcWriternocopy_readwriter.go
UnsafeLinkBuffernocopy_linkbuffer.go
SafeLinkBuffernocopy_linkbuffer_race.go
connectionconnection_impl.go

Calls

no outgoing calls

Tested by 5

TestOnConnectFunction · 0.52
TestOnDisconnectFunction · 0.52
TestNewFDConnectionFunction · 0.52