Shortcuts

Struct ThreadSafeFreelist::HeadPtr

Nested Relationships

This struct is a nested type of Class ThreadSafeFreelist.

Struct Documentation

struct ripple::ThreadSafeFreelist::HeadPtr

This struct is using a 32-bit offset into the freelist arena rather than a direct pointer, because together with the 32-bit tag, it needs to fit into 8 bytes to be atomic, which would not be the case if the offset was a pointer (even if the range of the tag was limited.

The tag is required so that there is no ABA problem where there is a pop in one thread, and a pop -> push in another, causing the new pushed head in the one thread to be in the same place as the popped head in the other, but with potentially different data. Updating the tag prevents this.

See the description in Node.

Public Members

int32_t offset

Offset into the arena, rather than pointer.

uint32_t tag

Tag to ensure atomic operations are correct.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples