9#ifndef satoko__utils__b_queue_h
10#define satoko__utils__b_queue_h
31static inline b_queue_t *b_queue_alloc(
unsigned cap)
45static inline void b_queue_push(
b_queue_t *
p,
unsigned Value)
47 if (
p->size ==
p->cap) {
49 p->sum -=
p->data[
p->i_first];
50 p->i_first = (
p->i_first + 1) %
p->cap;
55 p->data[
p->i_empty] = Value;
56 if ((++
p->i_empty) ==
p->cap) {
62static inline unsigned b_queue_avg(
b_queue_t *
p)
64 return (
unsigned)(
p->sum / ((
unsigned long)
p->size));
67static inline unsigned b_queue_is_valid(
b_queue_t *
p)
69 return (
p->cap ==
p->size);
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_HEADER_START struct b_queue_t_ b_queue_t
#define satoko_calloc(type, n_elements)