O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
reserve.c File Reference

Change a deque capacity after creation. More...

#include "o2s/deque.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

void deque_reserve (deque_t *self, size_t count)
 Reallocates the deque if count elements cannot fit in the current allocation.

Detailed Description

Change a deque capacity after creation.

Author
Tanguy BERTHOUD

Definition in file reserve.c.

Function Documentation

◆ deque_reserve()

void deque_reserve ( deque_t * self,
size_t count )

Reallocates the deque if count elements cannot fit in the current allocation.

If the reallocation failed, the capacity will be set to zero.

Todo
: Handle present elements when split !

Definition at line 25 of file reserve.c.