Go to the source code of this file.
|
| struct | item_t |
| | A queue comprised of an extendable circular buffer. More...
|
| struct | SELF |
| | An allocator that prints to stdout when it allocates or frees memory. More...
|
|
| static void | item_delete (item_t *self) |
| static item_t | item_clone (item_t const *self) |
| static SELF | new () |
| static SELF | clone (SELF const *self) |
| static ITEM const * | try_read (SELF const *self, INDEX_TYPE index) |
| static ITEM const * | read (SELF const *self, INDEX_TYPE index) |
| static ITEM * | try_write (SELF *self, INDEX_TYPE index) |
| static ITEM * | write (SELF *self, INDEX_TYPE index) |
| static ITEM * | try_push (SELF *self, ITEM item) |
| static bool | try_insert_at (SELF *self, INDEX_TYPE at, ITEM const *items, INDEX_TYPE count) |
| static void | remove_at (SELF *self, INDEX_TYPE at, INDEX_TYPE count) |
| static ITEM * | push (SELF *self, ITEM item) |
| static bool | try_pop (SELF *self, ITEM *destination) |
| static ITEM | pop (SELF *self) |
| static INDEX_TYPE | size (SELF const *self) |
| static void | delete (SELF *self) |
| static bool | empty_item (ITEM *const *item) |
| static ITEM * | next (ITER *iter) |
| static INDEX_TYPE | position (ITER const *iter) |
| static bool | empty (ITER const *iter) |
| static ITER | get_iter (SELF *self) |
| static bool | empty_item (ITEM const *const *item) |
| static ITEM const * | next (ITER_CONST *iter) |
| static INDEX_TYPE | position (ITER_CONST const *iter) |
| static bool | empty (ITER_CONST const *iter) |
| static ITER_CONST | get_iter_const (SELF const *self) |
| | TRAIT_VECTOR (SELF) |
◆ INDEX_TYPE
| #define INDEX_TYPE uint8_t |
◆ INPLACE_CAPACITY
| #define INPLACE_CAPACITY 8 |
◆ INVARIANT_CHECK
| #define INVARIANT_CHECK |
( |
| self | ) |
|
Value:
Definition at line 64 of file template.h.
64#define INVARIANT_CHECK(self) \
65 ASSUME(self); \
66 ASSUME((self->size) <= INPLACE_CAPACITY);
◆ ITEM
◆ ITEM_CLONE
◆ ITEM_DELETE
◆ index_t
◆ item
◆ clone()
Definition at line 81 of file template.h.
81 {
83 new_self.
size = self->size;
84
86 self->size *
sizeof(
ITEM));
89 }
90
91 return new_self;
92}
@ MEMORY_TRACKER_LVL_CONTAINER
static void memory_tracker_set(memory_tracker_level level, memory_tracker_capability cap, const volatile void *addr, size_t size)
@ MEMORY_TRACKER_CAP_WRITE
◆ delete()
| void delete |
( |
SELF * | self | ) |
|
|
static |
Definition at line 203 of file template.h.
203 {
207 }
210}
#define INVARIANT_CHECK(self)
@ MEMORY_TRACKER_CAP_NONE
◆ empty() [1/2]
| bool empty |
( |
ITER const * | iter | ) |
|
|
static |
Definition at line 240 of file template.h.
240 {
243 return iter->pos >= iter->vec->size;
244}
static void mutation_version_check(mutation_version const *self)
◆ empty() [2/2]
| bool empty |
( |
ITER_CONST const * | iter | ) |
|
|
static |
Definition at line 283 of file template.h.
283 {
286 return iter->pos >= iter->vec->size;
287}
◆ empty_item() [1/2]
| bool empty_item |
( |
ITEM *const * | item | ) |
|
|
static |
◆ empty_item() [2/2]
| bool empty_item |
( |
ITEM const *const * | item | ) |
|
|
static |
◆ get_iter()
| ITER get_iter |
( |
SELF * | self | ) |
|
|
static |
Definition at line 246 of file template.h.
246 {
248 return (ITER){.vec = self,
249 .pos = 0,
251}
static mutation_version mutation_tracker_get(mutation_tracker const *self)
mutation_tracker iterator_invalidation_tracker
◆ get_iter_const()
| ITER_CONST get_iter_const |
( |
SELF const * | self | ) |
|
|
static |
Definition at line 289 of file template.h.
289 {
291 return (ITER_CONST){
292 .vec = self,
293 .pos = 0,
295 };
296}
◆ item_clone()
◆ item_delete()
| void item_delete |
( |
item_t * | self | ) |
|
|
static |
◆ new()
Definition at line 68 of file template.h.
68 {
70 .size = 0,
73 };
76 return self;
77}
static gdb_marker gdb_marker_new()
static mutation_tracker mutation_tracker_new()
◆ next() [1/2]
| ITEM * next |
( |
ITER * | iter | ) |
|
|
static |
Definition at line 223 of file template.h.
223 {
226 if (iter->pos < iter->vec->size) {
227 ITEM*
item = &iter->vec->data[iter->pos];
228 iter->pos++;
230 }
231 return NULL;
232}
◆ next() [2/2]
| ITEM const * next |
( |
ITER_CONST * | iter | ) |
|
|
static |
Definition at line 266 of file template.h.
266 {
269 if (iter->pos < iter->vec->size) {
270 ITEM const*
item = &iter->vec->data[iter->pos];
271 iter->pos++;
273 }
274 return NULL;
275}
◆ pop()
Definition at line 192 of file template.h.
192 {
195 return entry;
196}
static bool try_pop(SELF *self, ITEM *destination)
◆ position() [1/2]
Definition at line 234 of file template.h.
234 {
237 return iter->pos;
238}
◆ position() [2/2]
Definition at line 277 of file template.h.
277 {
280 return iter->pos;
281}
◆ push()
Definition at line 173 of file template.h.
173 {
176 return slot;
177}
static ITEM * try_push(SELF *self, ITEM item)
◆ read()
Definition at line 102 of file template.h.
102 {
105 return value;
106}
static VALUE const * try_read(SELF const *self, INDEX index)
◆ remove_at()
Definition at line 155 of file template.h.
155 {
158
159 if (count == 0) {
160 return;
161 }
162
163 for (
INDEX_TYPE i = at; i < at + count; i++) {
165 }
166
167 memmove(&self->
data[at], &self->
data[at + count], (self->
size - (at + count)) *
sizeof(
ITEM));
171}
static INDEX_TYPE size(SELF const *self)
◆ size()
Definition at line 198 of file template.h.
198 {
200 return self->size;
201}
◆ TRAIT_VECTOR()
◆ try_insert_at()
Definition at line 136 of file template.h.
137 {
142
144 return false;
145 }
146
149 memmove(&self->
data[at + count], &self->
data[at], (self->
size - at) *
sizeof(
ITEM));
150 memcpy(&self->
data[at], items, count *
sizeof(
ITEM));
152 return true;
153}
static void mutation_tracker_mutate(mutation_tracker *self)
◆ try_pop()
| bool try_pop |
( |
SELF * | self, |
|
|
ITEM * | destination ) |
|
static |
Definition at line 179 of file template.h.
179 {
184 *destination = self->
data[self->
size];
187 return true;
188 }
189 return false;
190}
◆ try_push()
Definition at line 122 of file template.h.
122 {
131 return slot;
132 }
133 return NULL;
134}
◆ try_read()
Definition at line 94 of file template.h.
94 {
97 return &self->data[index];
98 }
99 return NULL;
100}
◆ try_write()
Definition at line 108 of file template.h.
108 {
111 return &self->
data[index];
112 }
113 return NULL;
114}
◆ write()
Definition at line 116 of file template.h.
116 {
119 return value;
120}
static VALUE * try_write(SELF *self, INDEX index)
◆ max_size