您的位置:首页 > 其它

内存分配器

2015-10-15 17:54 232 查看


本文由 @lonelyrains 出品,转载请注明出处。 
文章链接: http://blog.csdn.net/lonelyrains/article/details/16989651
http://blog.codingnow.com/2013/11/bump_pointer_allocator.html https://github.com/cloudwu/bpa



http://www.nedprod.com/programs/portable/nedmalloc/ http://sourceforge.net/projects/nedmalloc/files/latest/download

http://www.shannap.com/sagitta-engine-custom-memory-allocator.html

https://github.com/pyzhangxiang/SagittaEngine

http://blog.codingnow.com/2013/11/bump_pointer_allocator.html

https://github.com/cloudwu/bpa

伙伴内存分配的实现方式:

1、将总内存递归二分初始化,直到将叶子结点分到合适的大小L

2、获取内存需求大小K

3、如果超过叶子大小,则分配一个大于K、且是L的2的N次方尺寸。N满足L^2^(N-1) < K。

4、如果有内存被释放了,就与邻近的闲内存合并。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: