1
0
Fork
You've already forked salloc
0
A simple memory allocator.
  • C 96%
  • Makefile 4%
2024年08月13日 22:05:57 +03:00
.gitignore Initial commit. 2023年12月24日 13:43:18 +02:00
example Made allocator structure static. 2024年08月13日 22:05:57 +03:00
example.c Made allocator structure static. 2024年08月13日 22:05:57 +03:00
Makefile Fixed clean in Makefile 2023年12月24日 18:00:33 +02:00
README.md Made allocator structure static. 2024年08月13日 22:05:57 +03:00
salloc.h Made allocator structure static. 2024年08月13日 22:05:57 +03:00
test.c Made allocator structure static. 2024年08月13日 22:05:57 +03:00

A simple memory allocator.

Usage:

The whole library is in the single header file.

wget https://codeberg.org/unixer/salloc/raw/branch/main/salloc.h

example.c:

#include <stdio.h>#include "salloc.h"
int main(void)
{
 char *message = salloc(14); // Allocating the memory.

 message = "Hello world!\n";
 printf("%s", message);
 sfree(message); // Freeing the memory.
 sdeinit(); // Giving resources back to the system. Not necessary

 return 0;
}