https://github.com/laprej/buddy-allocator
Buddy system allocator
https://github.com/laprej/buddy-allocator
memory-allocation
Last synced: 4 months ago
JSON representation
Buddy system allocator
- Host: GitHub
- URL: https://github.com/laprej/buddy-allocator
- Owner: laprej
- License: bsd-3-clause
- Created: 2015-08-05T14:08:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-07T22:41:25.000Z (over 9 years ago)
- Last Synced: 2023-04-07T20:22:10.776Z (about 2 years ago)
- Topics: memory-allocation
- Language: C
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# buddy-allocator
This is a simple buddy system allocation scheme.
All of the metadata about the memory chunk (e.g., its size and whether it's currently being used) is stored at the beginning of that block of memory.
You can initialize it by calling `create_buddy_table()` and passing in the desired power of two.
For example, passing in 16 will create a buddy system of 2^16 = 65,536 bytes.
If it returns `NULL` then the buddy system was unable to allocate enough memory.