collection structs name replaced with macro

This commit is contained in:
2025-07-24 12:56:53 +03:00
parent 2dd6316b7b
commit eb6432470c
11 changed files with 47 additions and 43 deletions

View File

@@ -1,13 +1,13 @@
#include "tlibc/collections/List.h"
List List_alloc_size(u32 initial_size){
List_ List_alloc_size(u32 initial_size){
if(initial_size == 0)
return List_construct_size(NULL, 0, 0);
u32 allocated_size = ALIGN_TO(initial_size, sizeof(void*));
return List_construct_size(malloc(allocated_size), 0, allocated_size);
}
void* List_expand(List* ptr, u32 expansion_size){
void* List_expand(List_* ptr, u32 expansion_size){
u32 occupied_size = ptr->size;
u32 expanded_alloc_size = ptr->allocated_size;
if(expanded_alloc_size == 0)
@@ -22,12 +22,12 @@ void* List_expand(List* ptr, u32 expansion_size){
return (u8*)(ptr->data) + occupied_size;
}
void List_push_size(List* ptr, void* values, u32 size){
void List_push_size(List_* ptr, void* values, u32 size){
void* empty_cell_ptr = List_expand(ptr, size);
memcpy(empty_cell_ptr, values, size);
}
bool List_removeAt_size(List* ptr, u32 i, u32 remove_size){
bool List_removeAt_size(List_* ptr, u32 i, u32 remove_size){
if(i + remove_size >= ptr->size)
return false;