文件名称:buddy_算法
介绍说明--下载内容来自于网络,使用问题请自行百度
Buddy(伙伴)算法每次分配包含一个或者多个物理页面的内存块,页面以2的次幂的内存块来分配。首先搜寻满足请求大小的页面,它从满足当前申请大小的Buddy数据结构的m_ freePages域着手沿链来搜索空闲页面。如果没有这样请求大小的空闲页面,则它搜索两倍于请求大小的内存块。这个过程一直将持续到所有的Buddy 被搜索完或找到满足要求的内存块为。如果找到的页面块大于请求的块则对其进行分割以使其大小与请求块匹配。由于块大小都是2的次幂所以分割过程十分简单:空闲块(低地址)被连进相应大小的队列而这个页面块被分配给调用者。 释放时,先检查该块的伙伴的使用情况,如果没有被使用,则合并这对Buddy,再检查该两倍大小的块的Buddy,一直持续到合并后的块没有Buddy为止,并将之链到该大小的freepage队列中。-Buddy (partners) each allocation algorithm contains a number of physical pages or blocks of memory, two pages to the Powers of the block of memory to allocate. First of all search requests to meet the size of pages, from the application to meet the current size of the data structure Buddy 8 freePages domain proceed along the chain to search leisure pages. If no such request size spare pages, which then search request twice the size of a memory block. This process has to continue until all the Buddy Search End or were found to meet the requirements for the memory block. If found in the pages block greater than the requested block is divided in its size and make it the request block matching. As pieces are the two Powers So segmentation process is very simple : free block (low-address) was e
(系统自动生成,下载前可以参看下载内容)
下载文件列表
buddy算法.txt
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.