Mixes for Privacy and Anonymity in the Internet
|
Classes | |
struct | Block |
Public Member Functions | |
AE_NO_TSAN | ReaderWriterQueue (size_t maxSize=15) |
AE_NO_TSAN | ~ReaderWriterQueue () |
AE_FORCEINLINE bool | enqueue (UINT8 *const &element) AE_NO_TSAN |
bool | try_dequeue (UINT8 *&result) AE_NO_TSAN |
UINT8 * | peek () AE_NO_TSAN |
bool | pop () AE_NO_TSAN |
size_t | size_approx () const AE_NO_TSAN |
Public Attributes | |
UINT8 * | value_type |
Private Types | |
enum | AllocationMode { CanAlloc , CannotAlloc } |
Private Member Functions | |
bool | inner_enqueue (AllocationMode canAlloc, UINT8 *const &element) AE_NO_TSAN |
Static Private Member Functions | |
static AE_FORCEINLINE size_t | ceilToPow2 (size_t x) |
template<typename U > | |
static AE_FORCEINLINE UINT8 * | align_for (UINT8 *ptr) AE_NO_TSAN |
static Block * | make_block (size_t capacity) AE_NO_TSAN |
Private Attributes | |
weak_atomic< Block * > | frontBlock |
char | cachelineFiller [MOODYCAMEL_CACHE_LINE_SIZE - sizeof(weak_atomic< Block * >)] |
weak_atomic< Block * > | tailBlock |
size_t | largestBlockSize |
|
private |
|
explicit |
References ceilToPow2(), fence(), frontBlock, largestBlockSize, make_block(), MAX_BLOCK_SIZE, memory_order_sync, ReaderWriterQueue::Block::next, and tailBlock.
AE_NO_TSAN ReaderWriterQueue::~ReaderWriterQueue | ( | ) |
|
staticprivate |
|
staticprivate |
Referenced by ReaderWriterQueue().
AE_FORCEINLINE bool ReaderWriterQueue::enqueue | ( | UINT8 *const & | element | ) |
References CanAlloc, and inner_enqueue().
Referenced by BlockingReaderWriterQueue::enqueue().
|
private |
References CanAlloc, CannotAlloc, ReaderWriterQueue::Block::data, fence(), ReaderWriterQueue::Block::front, frontBlock, largestBlockSize, weak_atomic< T >::load(), ReaderWriterQueue::Block::localFront, make_block(), MAX_BLOCK_SIZE, memory_order_acquire, memory_order_release, ReaderWriterQueue::Block::next, ReaderWriterQueue::Block::sizeMask, ReaderWriterQueue::Block::tail, and tailBlock.
Referenced by enqueue().
|
staticprivate |
Referenced by inner_enqueue(), and ReaderWriterQueue().
UINT8* ReaderWriterQueue::peek | ( | ) |
References ReaderWriterQueue::Block::data, fence(), ReaderWriterQueue::Block::front, frontBlock, weak_atomic< T >::load(), ReaderWriterQueue::Block::localTail, memory_order_acquire, ReaderWriterQueue::Block::next, ReaderWriterQueue::Block::tail, and tailBlock.
Referenced by BlockingReaderWriterQueue::peek().
bool ReaderWriterQueue::pop | ( | ) |
References AE_UNUSED, compiler_fence(), ReaderWriterQueue::Block::data, fence(), ReaderWriterQueue::Block::front, frontBlock, weak_atomic< T >::load(), ReaderWriterQueue::Block::localTail, memory_order_acquire, memory_order_release, ReaderWriterQueue::Block::next, ReaderWriterQueue::Block::sizeMask, ReaderWriterQueue::Block::tail, and tailBlock.
Referenced by BlockingReaderWriterQueue::pop().
size_t ReaderWriterQueue::size_approx | ( | ) | const |
bool ReaderWriterQueue::try_dequeue | ( | UINT8 *& | result | ) |
References AE_UNUSED, compiler_fence(), ReaderWriterQueue::Block::data, fence(), ReaderWriterQueue::Block::front, frontBlock, weak_atomic< T >::load(), ReaderWriterQueue::Block::localTail, memory_order_acquire, memory_order_release, ReaderWriterQueue::Block::next, ReaderWriterQueue::Block::sizeMask, ReaderWriterQueue::Block::tail, and tailBlock.
Referenced by BlockingReaderWriterQueue::try_dequeue(), BlockingReaderWriterQueue::wait_dequeue(), and BlockingReaderWriterQueue::wait_dequeue_timed().
|
private |
|
private |
Referenced by inner_enqueue(), peek(), pop(), ReaderWriterQueue(), size_approx(), try_dequeue(), and ~ReaderWriterQueue().
|
private |
Referenced by inner_enqueue(), and ReaderWriterQueue().
|
private |
Referenced by inner_enqueue(), peek(), pop(), ReaderWriterQueue(), and try_dequeue().
UINT8* ReaderWriterQueue::value_type |