Queue* _queue_new(size_t dataSize)
{
Queue* queue = (Queue*) safe_malloc(sizeof (Queue));
+ queue->array = _vector_new(dataSize);
_queue_init(queue, dataSize);
return queue;
}
void queue_destroy(Queue* queue)
{
- queue_clear(queue);
+ vector_destroy(queue->array);
safe_free(queue);
}
Stack* _stack_new(size_t dataSize)
{
Stack* stack = (Stack*) safe_malloc(sizeof (Stack));
+ stack->array = _vector_new(dataSize);
_stack_init(stack, dataSize);
return stack;
}
void stack_destroy(Stack* stack)
{
- stack_clear(stack);
+ vector_destroy(stack->array);
safe_free(stack);
}