Rename internal types of m-core

This commit is contained in:
Patrick Pelissier committed 2020-10-03 14:07:14 +02:00
1 parent 1943650ca3
commit 6d47074457
2 files changed
+17 -17

No files matched your search

+6 -6
View File
@@ -156,7 +156,7 @@ M_BEGIN_PROTECTED_CODE
\
static inline void \
M_C(name, _lflist_push)(M_C(name, _lflist_t) list, \
M_C(name, _lf_node_t) *node, m_core_backoff_t bkoff) \
M_C(name, _lf_node_t) *node, m_core_backoff_ct bkoff) \
{ \
M_C(name, _lf_node_t) *tail; \
M_C(name, _lf_node_t) *next; \
@@ -191,7 +191,7 @@ M_BEGIN_PROTECTED_CODE
} \
\
static inline M_C(name, _lf_node_t) * \
M_C(name, _lflist_pop)(M_C(name, _lflist_t) list, m_core_backoff_t bkoff) \
M_C(name, _lflist_pop)(M_C(name, _lflist_t) list, m_core_backoff_ct bkoff) \
{ \
M_C(name, _lf_node_t) *head; \
M_C(name, _lf_node_t) *tail; \
@@ -243,7 +243,7 @@ M_BEGIN_PROTECTED_CODE
/* Dequeue a node if the node is old enough */ \
static inline M_C(name, _lf_node_t) * \
M_C(name, _lflist_pop_if)(M_C(name, _lflist_t) list, \
m_gc_ticket_t age, m_core_backoff_t bkoff) \
m_gc_ticket_t age, m_core_backoff_ct bkoff) \
{ \
M_C(name, _lf_node_t) *head; \
M_C(name, _lf_node_t) *tail; \
@@ -284,7 +284,7 @@ M_BEGIN_PROTECTED_CODE
static inline void \
M_C(name, _lflist_clear)(M_C(name, _lflist_t) list) \
{ \
m_core_backoff_t bkoff; \
m_core_backoff_ct bkoff; \
m_core_backoff_init(bkoff); \
while (true) { \
M_C(name, _lf_node_t) *node = M_C(name, _lflist_pop)(list, bkoff); \
@@ -566,8 +566,8 @@ typedef struct m_gc_mempool_list_s {
/* Define the Garbage collector thread data */
typedef struct m_gc_lfmp_thread_s {
m_gc_atomic_ticket_t ticket;
m_core_backoff_t bkoff;
M_CACHELINE_ALIGN(align1, atomic_ulong, m_core_backoff_t);
m_core_backoff_ct bkoff;
M_CACHELINE_ALIGN(align1, atomic_ulong, m_core_backoff_ct);
} m_gc_lfmp_thread_t;
/* Define the Garbage collector coordinator */
+11 -11
View File
@@ -3116,13 +3116,13 @@ m_core_parse2_enum (const char str[], const char **endptr)
typedef struct m_core_backoff_s {
unsigned int count; // Number of times it has been run
unsigned int seed; // Initial seed
} m_core_backoff_t[1];
} m_core_backoff_ct[1];
/* Initialize a backoff object.
* Use the C function rand to initialize its internal seed.
* It should be good enough for the purpose of the backoff */
static inline void
m_core_backoff_init(m_core_backoff_t backoff)
m_core_backoff_init(m_core_backoff_ct backoff)
{
backoff->count = 0;
backoff->seed = (unsigned int) rand();
@@ -3130,7 +3130,7 @@ m_core_backoff_init(m_core_backoff_t backoff)
/* Reset the count of the backoff object */
static inline void
m_core_backoff_reset(m_core_backoff_t backoff)
m_core_backoff_reset(m_core_backoff_ct backoff)
{
backoff->count = 0;
}
@@ -3139,7 +3139,7 @@ m_core_backoff_reset(m_core_backoff_t backoff)
* generating a random number of nanosecond to wait,
* and increment the number of times wait has been called */
static inline void
m_core_backoff_wait(m_core_backoff_t backoff)
m_core_backoff_wait(m_core_backoff_ct backoff)
{
/* x is qualified as volatile to avoid being optimized away
by the compiler in the active sleep loop */
@@ -3158,7 +3158,7 @@ m_core_backoff_wait(m_core_backoff_t backoff)
/* Clear the backoff object */
static inline void
m_core_backoff_clear(m_core_backoff_t backoff)
m_core_backoff_clear(m_core_backoff_ct backoff)
{
// Nothing to do
(void) backoff;
@@ -3213,14 +3213,14 @@ typedef union m_serial_ll_u {
size_t s;
void *p;
m_serial_return_code_t r;
} m_serial_ll_t;
} m_serial_ll_ct;
/* Object to handle the construction of a serial write/read of an object
that needs multiple calls (array, map, ...)
It is common to all calls to the same object and is used a state of parsing
local to the current structure being parsed */
typedef struct m_serial_local_s {
m_serial_ll_t data[M_SERIAL_MAX_DATA_SIZE];
m_serial_ll_ct data[M_SERIAL_MAX_DATA_SIZE];
} m_serial_local_t[1];
/* Object to handle the generic serial read of an object:
@@ -3232,8 +3232,8 @@ typedef struct m_serial_local_s {
* */
typedef struct m_serial_read_s {
const struct m_serial_read_interface_s *m_interface;
m_serial_ll_t tmp;
m_serial_ll_t data[M_SERIAL_MAX_DATA_SIZE];
m_serial_ll_ct tmp;
m_serial_ll_ct data[M_SERIAL_MAX_DATA_SIZE];
} m_serial_read_t[1];
/* Forward declaration of string_t defined in m-string.h */
@@ -3264,8 +3264,8 @@ typedef struct m_serial_read_interface_s {
* */
typedef struct m_serial_write_s {
const struct m_serial_write_interface_s *m_interface;
m_serial_ll_t tmp;
m_serial_ll_t data[M_SERIAL_MAX_DATA_SIZE];
m_serial_ll_ct tmp;
m_serial_ll_ct data[M_SERIAL_MAX_DATA_SIZE];
} m_serial_write_t[1];
/* Interface that has to be exported by the serial write object. */