A simple memory allocator.
- C 96%
- Makefile 4%
| .gitignore | Initial commit. | |
| example | Made allocator structure static. | |
| example.c | Made allocator structure static. | |
| Makefile | Fixed clean in Makefile | |
| README.md | Made allocator structure static. | |
| salloc.h | Made allocator structure static. | |
| test.c | Made allocator structure static. | |
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;
}