feat: implemented liballoc for proper malloc

This commit is contained in:
2021-02-27 13:19:14 +01:00
parent 9f72d4bb1a
commit 9fdc89a3a6
6 changed files with 825 additions and 80 deletions

View File

@@ -25,7 +25,7 @@ void *create_buffer(int count, int object_size) {
buffer->count = count;
buffer->read_pos = 0;
buffer->write_pos = 0;
buffer->mem = malloc(count * object_size);
buffer->mem = calloc(object_size, count);
if (buffer->mem == NULL) {
free(buffer);
return NULL;