MCPcopy
hub / github.com/saltstack/salt / _pack_offset

Method _pack_offset

salt/utils/mmap_cache.py:278–280  ·  view source on GitHub ↗

Pack segment ID and within-segment offset into a single uint64.

(self, seg_id, seg_offset)

Source from the content-addressed store, hash-verified

276 return max(0, len(self._seg_mms) - 1)
277
278 def _pack_offset(self, seg_id, seg_offset):
279 """Pack segment ID and within-segment offset into a single uint64."""
280 return (seg_id << _SEG_ID_SHIFT) | (seg_offset & _SEG_OFF_MASK)
281
282 def _unpack_offset(self, packed):
283 """Unpack a packed offset into (seg_id, seg_offset)."""

Callers 6

_append_to_heapMethod · 0.95
atomic_rebuildMethod · 0.95
test_pack_unpack_zeroMethod · 0.80
test_pack_unpack_seg1Method · 0.80

Calls

no outgoing calls

Tested by 4

test_pack_unpack_zeroMethod · 0.64
test_pack_unpack_seg1Method · 0.64