Types
UpperByte = distinct UpperByteImpl
-
uses first byte as tag, sign extends when converting to pointer
tag byte is addressable
Source Edit UpperByteImpl = byte
- Source Edit
UpperByteTagged[T] = Tagged[T, UpperByte]
- Source Edit
Procs
proc splitTagMut(tagged: var Tagged[uint, UpperByte]): var UpperByte {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc splitTagMut[T: PointerLike](tagged: var Tagged[T, UpperByte]): var UpperByte
- Source Edit
proc tagUpperByte[T](val: T; tag: UpperByteImpl): UpperByteTagged[T] {.inline.}
- Source Edit
Templates
template getTag[T](tagged: UpperByteTagged[T]): UpperByteImpl
- Source Edit
template getTagMut[T](tagged: UpperByteTagged[T]): UpperByteImpl
- Source Edit
template splitTagInline[T: PointerLike](tagged: Tagged[T, UpperByte]): UpperByte
- Source Edit
template splitTagMutInline[T: PointerLike](tagged: var Tagged[T, UpperByte]): var UpperByte
- Source Edit
template untagInline(tagged: Tagged[uint, UpperByte]): uint
- Source Edit
template untagInline[T: PointerLike](tagged: Tagged[T, UpperByte]): T
- Source Edit
template withTagInline[T: PointerLike](val: T; t: UpperByte): Tagged[T, UpperByte]
- Source Edit