https://github.com/bo1led-owl/spalloc
Toy allocator with C interface written in Zig
https://github.com/bo1led-owl/spalloc
allocators c memory-managament zig
Last synced: 5 months ago
JSON representation
Toy allocator with C interface written in Zig
- Host: GitHub
- URL: https://github.com/bo1led-owl/spalloc
- Owner: bo1led-owl
- License: gpl-3.0
- Created: 2024-11-04T12:05:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T14:31:53.000Z (over 1 year ago)
- Last Synced: 2025-01-04T12:09:06.196Z (about 1 year ago)
- Topics: allocators, c, memory-managament, zig
- Language: Zig
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spalloc
Toy allocator written in Zig, inspired by [Sys.Pro](https://sys.pro/) C programming language course task.
## Features
- No chunk headers
- Using additional memory only when chunks get allocated
- Special treatment of different types of chunks for better performance
## Usage
`spalloc.h` provides `spmalloc`, `spcalloc`, `sprealloc` and `spfree` functions. These functions have the same API as the standard C `malloc`, `calloc`, `realloc` and `free`.
## Building
Just use `zig build` with standard optimization options. By default it builds a static library.
To build the shared version, pass `-Dshared` option.