MySQL 9.1.0
Source Code Documentation
|
Class for using fuzzy counters. More...
#include <ut0counter.h>
Public Member Functions | |
ib_counter_t () | |
~ib_counter_t () | |
bool | validate () 1 |
void | inc () 1 |
If you can't use a good index id. More... | |
void | add (Type n) 1 |
If you can't use a good index id. More... | |
void | add (size_t index, Type n) 1 |
Use this if you can use a unique identifier, saves a call to get_rnd_index(). More... | |
void | dec () 1 |
If you can't use a good index id. More... | |
void | sub (Type n) 1 |
If you can't use a good index id. More... | |
void | sub (size_t index, Type n) 1 |
Use this if you can use a unique identifier, saves a call to get_rnd_index(). More... | |
operator Type () const 1 | |
Type | operator[] (size_t index) const 1 |
Static Public Member Functions | |
static bool | is_fast () |
Private Attributes | |
Indexer< Type, N > | m_policy |
Indexer into the array. More... | |
Type | m_counter [(N+1) *(ut::INNODB_CACHE_LINE_SIZE/sizeof(Type))] |
Slot 0 is unused. More... | |
Class for using fuzzy counters.
The counter is not protected by any mutex and the results are not guaranteed to be 100% accurate but close enough. Creates an array of counters and separates each element by the ut::INNODB_CACHE_LINE_SIZE bytes
|
inline |
|
inline |
|
inline |
Use this if you can use a unique identifier, saves a call to get_rnd_index().
index | index into a slot |
n | amount to increment |
|
inline |
If you can't use a good index id.
n | is the amount to increment |
|
inline |
If you can't use a good index id.
Decrement by 1.
|
inline |
If you can't use a good index id.
Increment by 1.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
Use this if you can use a unique identifier, saves a call to get_rnd_index().
index | index into a slot |
n | amount to decrement |
|
inline |
If you can't use a good index id.
n | the amount to decrement |
|
inline |
|
private |
Slot 0 is unused.
|
private |
Indexer into the array.