littlekernel / lk

LK embedded kernel
MIT License
3.19k stars 628 forks source link

cmpctmalloc: Tweak bucket sizes to optimize power-of-2 allocs. #75

Closed ErikCorryGoogle closed 8 years ago

ErikCorryGoogle commented 8 years ago

With this change allocations of > 128 bytes that are powers of two will be allocated at the exact size requested, instead of being subjected to worst-case round-up of 1/8th (12.5%).

Fix and test heap_trim better. The tests now do trims with tricky free sizes at the start and end of OS allocation areas (just around 1 page).

Add an assert for the most obvious double frees in debug mode.

travisg commented 8 years ago

merged