f17-improvement-consistency-performance #25

Merged
Mineplay merged 33 commits from f17-improvement-consistency-performance into main 2025-07-10 16:57:05 -05:00
Showing only changes of commit 5f87686633 - Show all commits

View file

@ -76,7 +76,7 @@ FledastyError fledasty_stack_push(FledastyStack *current_stack, void *value) {
if (current_stack->size == current_stack->capacity) {
current_stack->capacity += current_stack->capacity;
current_stack->buffer = (unsigned char*)hallocy_realloc(current_stack->buffer, current_stack->capacity);
current_stack->buffer = (unsigned char*)hallocy_realloc(current_stack->buffer, current_stack->capacity * current_stack->element_byte_size);
if (current_stack->buffer == NULL) {
return FLEDASTY_ERROR_FAILED_ALLOCATION;
@ -102,10 +102,8 @@ void *fledasty_stack_pop(FledastyStack *current_stack) {
return NULL;
}
void *value_address = current_stack->buffer + ((current_stack->size - 1) * current_stack->element_byte_size);
current_stack->size -= 1;
return value_address;
return current_stack->buffer + (current_stack->size * current_stack->element_byte_size);
}
FledastyError fledasty_stack_clear(FledastyStack *current_stack) {