StringBuilder_alloc

This commit is contained in:
Timerix 2025-02-02 19:16:29 +05:00
parent 7c2809aae2
commit 8a38813ba5
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
void StringBuilder_free(StringBuilder* b){
free(b->buffer.data);
b->buffer = List_u8_construct(NULL, 0, 0);
}
str StringBuilder_getStr(StringBuilder* b){

View File

@ -7,7 +7,7 @@ typedef struct StringBuilder {
List_u8 buffer;
} StringBuilder;
static inline StringBuilder StringBuilder_construct(u32 initial_size) {
static inline StringBuilder StringBuilder_alloc(u32 initial_size) {
return (StringBuilder){ .buffer = List_u8_alloc(initial_size) };
}
void StringBuilder_free(StringBuilder* b);