froth/upperbits

Source   Edit  

Types

UpperBits = distinct UpperBitsImpl
shifts pointer 3 bits to the right, shifts 3 bit tag 61 bits to the left Source   Edit  
UpperBitsImpl = range[0 .. 7]
Source   Edit  

Procs

proc splitTag(tagged: Tagged[uint, UpperBits]): UpperBits {.inline, ...raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc splitTag[T: PointerLike](tagged: Tagged[T, UpperBits]): UpperBits {.inline.}
Source   Edit  
proc tagUpperBits[T](val: T; tag: UpperBitsImpl): UpperBitsTagged[T] {.inline.}
Source   Edit  
proc untag(tagged: Tagged[uint, UpperBits]): uint {.inline, ...raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc untag[T: PointerLike](tagged: Tagged[T, UpperBits]): T {.inline.}
Source   Edit  
proc withTag(val: uint; tag: UpperBits): Tagged[uint, UpperBits] {.inline,
    ...raises: [], tags: [], forbids: [].}
Source   Edit  
proc withTag[T: PointerLike](val: T; t: UpperBits): Tagged[T, UpperBits] {.
    inline.}
Source   Edit  

Templates

template `[]`[T: PointerLike](tagged: Tagged[T, UpperBits]): untyped
Source   Edit  
template getTag[T](tagged: UpperBitsTagged[T]): UpperBitsImpl
Source   Edit  
template isNil[T: PointerLike](tagged: Tagged[T, UpperBits]): bool
Source   Edit  
template splitTagInline(tagged: Tagged[uint, UpperBits]): UpperBits
Source   Edit  
template splitTagInline[T: PointerLike](tagged: Tagged[T, UpperBits]): UpperBits
Source   Edit  
template untagInline(tagged: Tagged[uint, UpperBits]): uint
Source   Edit  
template untagInline[T: PointerLike](tagged: Tagged[T, UpperBits]): T
Source   Edit  
template withTagInline(val: uint; tag: UpperBits): Tagged[uint, UpperBits]
Source   Edit  
template withTagInline[T: PointerLike](val: T; t: UpperBits): Tagged[T,
    UpperBits]
Source   Edit