在μC/OS-Ⅱ的内存管理中,内存被分成多个内存分区,每个分区又包含整数个大小固定的内存块,且释放时必须回到所属分区.缺少灵活性,容易产生内存碎片,内存利用率不高.利用Tertiary Buddy System算法,将可用内存划分为2k和3×2k.增加了可选择的内存块大小数目及种类.提高了μC/OS-Ⅱ中内存的使用率,同时在灵活性和可靠性上有了很大提高.%In μC/OS-Ⅱ memory management, memory is divided into a couple of memory divisions, in each division there is the fixed-size memory block in integer number, and the block must be returned to the respective division when released. This makes it lack of the flexibility and easy to generate memory fragment, and the memory utilisation rate is not high. In this paper we make use of Tertiary Buddy System algorithm, divide the available memory into 2k and 3×2k. This increases the selectable memory block size, number and type. The μC/OS-Ⅱ memory utilisation rate is then improved. At the same time, the flexibility and reliability have also been improved a lot too.
展开▼