21161的内存分配方法在visualdsp 5 中的改变
2009-11-24 11:00
169 查看
在之前的版本中,如v3.5,栈和堆是在ldf中独立分配的。在v 5中,为了更有效的利用内存,会在连接时变大以利用所有剩余的空间。
默认的堆栈大小是8K,可以在下面第一句改变大小,以增加dmda实际可用内存。
seg_dmda
{
RESERVE(heaps_and_stack, heaps_and_stack_length = 8K, 2)
INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))
RESERVE_EXPAND(heaps_and_stack, heaps_and_stack_length, 0, 2)
ldf_stack_space = heaps_and_stack;
ldf_stack_end = (ldf_stack_space + ((heaps_and_stack_length * 6K) / 8K) - 2) & 0xfffffffe;
ldf_stack_length = ldf_stack_end - ldf_stack_space;
ldf_heap_space = ldf_stack_end + 2;
ldf_heap_end = ldf_heap_space + ((heaps_and_stack_length * 2K) / 8K) - 2;
ldf_heap_length = ldf_heap_end - ldf_heap_space;
} >seg_dmda
The memory for the stack and heap is allocated as follows:
An area of memory in one of the default memory areas (for example, seg_dmda) is reserved for the stack and heap, using the RESERVE() command.
Memory is allocated to data that must be placed in this section (for example, global variables and static variables).
The RESERVE_EXPAND() command is used to claim any unused space in the default memory area and allocate it to the stack and heap. The ratio of memory allocated to the stack and heap can be adjusted if necessary.
默认的堆栈大小是8K,可以在下面第一句改变大小,以增加dmda实际可用内存。
seg_dmda
{
RESERVE(heaps_and_stack, heaps_and_stack_length = 8K, 2)
INPUT_SECTIONS( $OBJECTS(seg_dmda) $LIBRARIES(seg_dmda))
RESERVE_EXPAND(heaps_and_stack, heaps_and_stack_length, 0, 2)
ldf_stack_space = heaps_and_stack;
ldf_stack_end = (ldf_stack_space + ((heaps_and_stack_length * 6K) / 8K) - 2) & 0xfffffffe;
ldf_stack_length = ldf_stack_end - ldf_stack_space;
ldf_heap_space = ldf_stack_end + 2;
ldf_heap_end = ldf_heap_space + ((heaps_and_stack_length * 2K) / 8K) - 2;
ldf_heap_length = ldf_heap_end - ldf_heap_space;
} >seg_dmda
Memory Allocation for Stack and Heap on ADSP-2106x, 2116x and 2126x Processors
In previous releases of VisualDSP++, the default stack and heap were allocated separate memory sections in the LDFs. In VisualDSP++ 5.0, for ADSP-210xx, 2116x and 2126x processors, the allocation of memory for stacks and heaps is performed by the linker at link-time, resulting in more efficient memory use. (For ADSP-213xx processors, the stack and heap allocation remains the same because of the increased number of memory blocks.)The memory for the stack and heap is allocated as follows:
An area of memory in one of the default memory areas (for example, seg_dmda) is reserved for the stack and heap, using the RESERVE() command.
Memory is allocated to data that must be placed in this section (for example, global variables and static variables).
The RESERVE_EXPAND() command is used to claim any unused space in the default memory area and allocate it to the stack and heap. The ratio of memory allocated to the stack and heap can be adjusted if necessary.
相关文章推荐
- C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- JAVA 堆栈 堆 方法区 静态区 final static 内存分配 详解
- 图解Java多态内存分配以及多态中成员方法的特点
- JAVA 堆栈 堆 方法区 静态区 final static 内存分配 详解
- SQL服务器内存有两种基本管理方法:动态分配和静态分配
- Java虚拟机垃圾回收:内存分配与回收策略 方法区垃圾回收 以及 JVM垃圾回收的调优方法
- Android studio 分配内存设置方法
- Linux或Windows下 改变Tomcat JVM 内存设置方法
- C++内存分配的五种方法的区别
- 在Linux和Windows下Tomcat分配大内存设置方法
- 明晰C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- MySQL不同内存分配方法的配置及简单对比
- 明晰C++内存分配的五种方法的区别
- 明晰C++内存分配的五种方法的区别
- java的内存分配方法