Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 519 Bytes

File metadata and controls

16 lines (13 loc) · 519 Bytes

CompressedSharedPtr

Compressed shared_ptr

handle is a 64-bit integer where:

  • Lower 42 bits represent the pointer bits.
  • Upper 22 bits represent the reference count.
//  +----------------------+----------------------+
//  |   22 bits refcount  |   42 bits pointer     |
//  +----------------------+----------------------+
//
//   bit layout example:
//   [ 63 ....................  42 | 41 ................................ 0 ]
//   [         refCount            |              rawPtr                   ]