Array_free
This commit is contained in:
parent
425794361b
commit
89aab2b5bf
@ -37,6 +37,10 @@ static inline Array_ Array_copy(const Array_ self){
|
||||
return copy;
|
||||
}
|
||||
|
||||
static inline void Array_free(Array_ self){
|
||||
free(self.data);
|
||||
}
|
||||
|
||||
#define Array_len(SELF, T) (SELF.size / sizeof(T))
|
||||
#define Array_memset(SELF, VAL) memset(SELF.data, VAL, SELF.size)
|
||||
|
||||
|
||||
@ -20,6 +20,10 @@ static inline List_ List_construct_size(void* data_ptr, u32 occupied_size, u32 a
|
||||
#define List_alloc(T, INITIAL_COUNT) List_alloc_size((INITIAL_COUNT) * sizeof(T))
|
||||
List_ List_alloc_size(u32 initial_size);
|
||||
|
||||
static inline void List_destroy(List_ self){
|
||||
free(self.data);
|
||||
}
|
||||
|
||||
List_ List_copy(List_ src);
|
||||
|
||||
// alloc bigger buffer if size + size_to_add won't fit in current
|
||||
|
||||
@ -22,7 +22,7 @@ static inline str str_from_cstr(cstr s_ptr){
|
||||
return str_construct((void*)s_ptr, strlen(s_ptr), true);
|
||||
}
|
||||
|
||||
static inline void str_destroy(str s){
|
||||
static inline void str_free(str s){
|
||||
free(s.data);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user