#pointer #tagging #concurrency

no-std tagptr

Strongly typed atomic and non-atomic tagged pointers

1 unstable release

0.2.0 Aug 13, 2021

#193 in No standard library

Download history 57/week @ 2022-01-29 636/week @ 2022-02-05 1659/week @ 2022-02-12 1658/week @ 2022-02-19 1902/week @ 2022-02-26 1927/week @ 2022-03-05 2010/week @ 2022-03-12 2565/week @ 2022-03-19 3063/week @ 2022-03-26 5236/week @ 2022-04-02 4293/week @ 2022-04-09 3387/week @ 2022-04-16 2905/week @ 2022-04-23 3287/week @ 2022-04-30 2738/week @ 2022-05-07

12,678 downloads per month
Used in 19 crates (via moka)

MIT/Apache

70KB
1K SLoC

tagptr

Strongly typed marked pointers for storing bit patterns (tags) alongside raw pointers for concurrent programming with atomic operations.

Build Status Latest version Documentation License

Usage

Add the following to your Cargo.toml

[dependencies]
tagptr = "0.2.0"

Motivation

Most atomic CPU instructions only work with register-sized memory words (e.g., 32-bit or 64-bit). Many low-level concurrent algorithms thus need to store aditional data (tags) in the unused lower bits of pointers to referenced data objects. This crate provides thin and efficient abstractions for working with such pointers.

License

tagptr is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

No runtime deps