Skip to content

feat(frailbox): add buddy allocator with stats and tests (Closes #2) - #37

Open
yanyishuai wants to merge 1 commit into
GautamKumarOffical:mainfrom
yanyishuai:fix/gk-issue-2-buddy-allocator
Open

feat(frailbox): add buddy allocator with stats and tests (Closes #2)#37
yanyishuai wants to merge 1 commit into
GautamKumarOffical:mainfrom
yanyishuai:fix/gk-issue-2-buddy-allocator

Conversation

@yanyishuai

Copy link
Copy Markdown

Summary

Adds a power-of-two buddy allocator (buddy_alloc, buddy_free, buddy_stats) with 64-byte minimum blocks, buddy coalescing, fragmentation metrics, and a focused test-buddy target. Portable aligned allocation works on Linux and Windows.

Closes #2

Acceptance criteria

  • buddy_alloc(), buddy_free(), and buddy_stats() implemented
  • Power-of-two sizing with 64-byte minimum blocks
  • Free block coalescing and fragmentation ratio tracking
  • Compiles with -Wall -Wextra -Wpedantic

Testing

make -C frailbox clean
make -C frailbox test-buddy
python3 build.py -m frailbox

Wallet: Do4v7foHJvRJLpRRoGaVPWX6DDEjX3yTK7J91gpwUQpE

@yanyishuai
yanyishuai force-pushed the fix/gk-issue-2-buddy-allocator branch from 3eb10ec to 4a08a66 Compare July 1, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bounty: C Buddy Allocator

1 participant