Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azer0s/pogmalloc
A poggers malloc implementation
https://github.com/azer0s/pogmalloc
garbage-collection garbage-collector malloc-free memory memory-allocation memory-allocator
Last synced: 3 days ago
JSON representation
A poggers malloc implementation
- Host: GitHub
- URL: https://github.com/azer0s/pogmalloc
- Owner: Azer0s
- License: wtfpl
- Created: 2021-10-30T21:10:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-03T19:15:53.000Z (about 3 years ago)
- Last Synced: 2024-05-19T00:33:06.963Z (6 months ago)
- Topics: garbage-collection, garbage-collector, malloc-free, memory, memory-allocation, memory-allocator
- Language: C
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pogmalloc(3)
A poggers malloc implementation
### Features
* Static allocator
* Real heap allocator (via `sbrk(2)`)
* Builtin GC
* Can also mark static memory
* Can be enabled via define
* Debug and trace logs
* Can be enabled via define
* Works on ARM & x86_64
* Works with GCC and clang### Limitations
* Doesn't work on Windows
* Kinda flimsy tbh (it's cool and all but don't use it in prod lmao)
* GC doesn't work for packed structs or obfuscated pointers### Credits
Credits to Tsoding and his amazing malloc series, this allocator was heavily inspired by his:
* https://github.com/tsoding/memalloc
* https://www.youtube.com/watch?v=sZ8GJ1TiMdk&ab_channel=TsodingDaily#### Differences to memalloc
While pogmalloc was inspired by Tsodings memalloc, there are a couple of key differences. memalloc focuses on garbage collection, while
pogmalloc aims to be as dynamic as possible, providing just a barebones malloc algorithm with specific memory model implementations built
on top (I originally built pogmalloc as a bare metal OS allocator for an OSDev project). Furthermore, pogmalloc can allocate memory on the actual heap (thus is not limited to static data) and, from what I've gathered
in my quick (and truth be told, probably very inaccurate) testing, is faster than memalloc (but is also way less memory efficient than memalloc because
chunks are only squashed as a method of last resort).