parent
fa10d64aee
commit
b38362c2aa
5
list.c
5
list.c
|
@ -64,6 +64,11 @@ void list_reserve(List* self, size_t at_least) {
|
||||||
self->cap = new_cap;
|
self->cap = new_cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void list_set_len(List* self, size_t len) {
|
||||||
|
list_reserve(self, len);
|
||||||
|
self->len = len;
|
||||||
|
}
|
||||||
|
|
||||||
void* list_at_unchecked(List* self, size_t at) {
|
void* list_at_unchecked(List* self, size_t at) {
|
||||||
union {
|
union {
|
||||||
uint8_t* as_byte;
|
uint8_t* as_byte;
|
||||||
|
|
1
list.h
1
list.h
|
@ -17,6 +17,7 @@ extern List list_copy(const List* source);
|
||||||
extern void list_empty(List* list);
|
extern void list_empty(List* list);
|
||||||
|
|
||||||
extern void list_reserve(List* self, size_t at_least);
|
extern void list_reserve(List* self, size_t at_least);
|
||||||
|
extern void list_set_len(List* self, size_t len);
|
||||||
extern void* list_at(List* list, size_t at);
|
extern void* list_at(List* list, size_t at);
|
||||||
extern void* list_at_unchecked(List* self, size_t at);
|
extern void* list_at_unchecked(List* self, size_t at);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue