Skip to content

Commit

Permalink
add resize function
Browse files Browse the repository at this point in the history
  • Loading branch information
BragdonD committed Oct 9, 2022
1 parent 1bafc5b commit 550e49a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/static_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,9 @@ void* staticQueue_pop(static_queue* queue) {
}

bool resize(static_queue* queue, int size) {
void *arr = NULL;
arr = realloc(queue->arr, size * queue->elem_size);
if(arr == NULL) return false;
queue->arr = arr;
return false;
}

0 comments on commit 550e49a

Please sign in to comment.