diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:07:58 +0200 |
| commit | 967be9e750221ab2ab783f95df79bb26d290a45e (patch) | |
| tree | 6802900a5e975f9f68b169f0f503f040056d6952 /malloc/block_allocator/utils.c | |
Diffstat (limited to 'malloc/block_allocator/utils.c')
| -rw-r--r-- | malloc/block_allocator/utils.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/malloc/block_allocator/utils.c b/malloc/block_allocator/utils.c new file mode 100644 index 0000000..d38dca0 --- /dev/null +++ b/malloc/block_allocator/utils.c @@ -0,0 +1,16 @@ +#include "utils.h" + +#include <stdio.h> + +void read_data(struct blk_meta *meta) +{ + for (size_t i = 0; i < meta->size && meta->data[i] != '\0'; ++i) + putchar(meta->data[i]); +} + +void write_data(struct blk_meta *meta, char *data, size_t n) +{ + for (size_t i = 0; i < n; ++i) + meta->data[i] = data[i]; + meta->data[n] = '\0'; +} |
