精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。需要全文内容也请联系孙老师。
RTLinux provides support for neither dynamic memory management nor virtual memory. This component provides the basic malloc, free and remalloc library functions. RTLinux不支持动态内存管理,也不支持虚拟内存。此组件提供基本的和自由的remalloc库函数。
This component meet the realtime requirements, that is, it will have a bounded and predictable worst case response time. Other, design guidelines are: 这个组件满足实时要求,也就是说,它将有一个有界可预测的最坏情况下的响应时间。其他设计准则是:
Low internal fragmentation.低内部分裂。
None external fragmentation.没有外部碎片
Immediate coalescing.直接合并
Definable minimum block size.可定义的最小块大小。
Definable splitting threshold.可确定的分割阈值。
The new proposed (and implemented) allocation algorithm is called Doubly Indexed Dynamic Memory Allocator (DIDMA). 新提出的(实施)的分配算法被称为双重动态索引内存分配器(DIDMA)。
Originally is was designed as a high-level RTLinux component, but it can be easily ported to be used in the high-level Linux layer to replace the non-realtime glibc dynamic memory implementation. 最初被设计为高层RTLinux组件,但是它可以被很容易地移植在高级别Linux的层可以用来代替非实时的glibc动态存储器执行。
In order to avoid naming conflicts, the API provided by DIDMA is non POSIX, it looks like the API given by the ANSI C standard adding a rt_ prefix: 为了避免命名冲突,由DIDMA提供的API是非POSIX,它看起来像由ANSI C标准添加一个前缀rt_给出的API::
void *rt_malloc (size_t size)
void rt_free (void *ptr)
void *rt_calloc (size_t nelem, size_t elem_size)
void *rt_realloc (void *p, size_t new_len)
DIDMA uses an indexed strategy with a fixed size preallocated data structure. The structure used by DIDMA is implemented as two arrays indexed by two indexes. DIDMA使用一个索引策略,预先分配一个固定大小的数据结构。通过DIDMA使用的结构被实现为由两个数组,它被2个索引器进行了索引。
Mapping functions are used to quickly find the list of the required block size. The mapping functions are optimised to use fast numeric functions (shifts, adds, etc). 映射函数用于快速找到所需要块大小的列表。映射函数优化使用快速数值函数(转移、增加等)。
The size of each of these two arrays is not fixed and can be customised to fulfil the specific application requirements. These two parameters determine the response time of the malloc() and free() functions and also the maximum fragmentation. A guide to select the best valued of these parameters will be provided with the final version of this component.
这两个数组的大小不是固定的,可以定制完成特定的应用程序需求。这两个参数确定malloc()和free()函数以及最大碎片的响应时间。一个指南选择这些参数的最佳值将提供该组件的最终版本。
The worst case temporal complexity of the proposed algorithm (DIDMA) has to be bounded and it is data independent. The results of the tests (benchmarks) previously presented show that DIDMA has better response time than the following studied algorithms: 最坏的情况下该算法的时间复杂性(DIDMA)必须是有界的,它是数据独立。之前的测试结果(基准)提出了表明下面的研究有比时间算法更好的相应时间算法::
Binary Buddy 二进制的好友Here are some preliminary results, running on an Athlon XP 2000 with 512 Mbytes of RAM. The DIDMA algorithm parameters has been customised to First_Level_Index = 24 (with this value the size of the memory pool will be 16 MBytes) and Second_Level_Index = 16 (the second level index has importance on the internal fragmentation), which are reasonable default values.
这里有一些初步的成果,与512字节RAM运行的Athlon XP2000。该DIDMA算法参数已经customised.dat到First_Level_Index= 24(与存储器池的thisValue的大小将是16兆字节)和Second_Level_Index= 16(第二级索引对内部碎片重要性),这是合理的默认值。