MCPcopy
hub / github.com/cortexlabs/cortex / unpack

Function unpack

pkg/proxy/breaker.go:307–309  ·  view source on GitHub ↗

unpack takes an uint64 and returns two uint32 (as uint64) comprised of the leftmost and the rightmost bits respectively.

(in uint64)

Source from the content-addressed store, hash-verified

305// unpack takes an uint64 and returns two uint32 (as uint64) comprised of the leftmost
306// and the rightmost bits respectively.
307func unpack(in uint64) (uint64, uint64) {
308 return in >> 32, in & 0xffffffff
309}
310
311// pack takes two uint32 (as uint64 to avoid casting) and packs them into a single uint64
312// at the leftmost and the rightmost bits respectively.

Callers 7

TestBreakerOverloadMixedFunction · 0.85
TestPackUnpackFunction · 0.85
tryAcquireMethod · 0.85
acquireMethod · 0.85
releaseMethod · 0.85
updateCapacityMethod · 0.85
CapacityMethod · 0.85

Calls

no outgoing calls

Tested by 2

TestBreakerOverloadMixedFunction · 0.68
TestPackUnpackFunction · 0.68