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

Function malloc

nocopy.go:271–276  ·  view source on GitHub ↗

malloc limits the cap of the buffer from mcache.

(size, capacity int)

Source from the content-addressed store, hash-verified

269
270// malloc limits the cap of the buffer from mcache.
271func malloc(size, capacity int) []byte {
272 if capacity > mallocMax {
273 return dirtmake.Bytes(size, capacity)
274 }
275 return mcache.Malloc(size, capacity)
276}
277
278// free limits the cap of the buffer from mcache.
279func free(buf []byte) {

Callers 3

NextMethod · 0.85
PeekMethod · 0.85
newLinkBufferNodeFunction · 0.85

Calls 2

MallocMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…