24 return (
deque_t){.storage = storage,
28 .type_size = type_size,
29 .capacity = capacity};
38 void* storage = calloc(capacity, type_size);
42 return deque_new(storage, capacity, type_size);
void deque_free(deque_t *self)
Frees properly the deque.
void deque_clear(deque_t *self)
Clears properly the deque.
deque_t deque_new(void *storage, size_t capacity, size_t type_size)
Contructs an deque, using externally owned memory.
deque_t deque_allocate(size_t capacity, size_t type_size)
Constructs a deque, allocating the needed memory.
Realtime double-ended queues.
void * back
Pointer past-the-end of the queue.
void * front
Pointer to the front of the queue.
size_t capacity
Maximum number of elements that can be stored.
size_t count
Number of elements currently stored.
void * storage
Memory area.