594832359 发表于 2012-9-5 21:41:05

关于IAR使用的一个疑问!!!请教高手~


这个选项卡里Stack Size代表堆栈大小,后面的Data16 heap是什么意思啊,该怎么设定呢?

lcofjp 发表于 2012-9-5 22:12:21

heap是堆吧,不动态申请内存是用不到的,编译器也就不占用这些空间了,随便说说

594832359 发表于 2012-9-6 00:11:22

lcofjp 发表于 2012-9-5 22:12 static/image/common/back.gif
heap是堆吧,不动态申请内存是用不到的,编译器也就不占用这些空间了,随便说说 ...

非常感谢!看来就不用分配这么多heap空间啦

lcofjp 发表于 2012-9-6 00:27:21

594832359 发表于 2012-9-6 00:11 static/image/common/back.gif
非常感谢!看来就不用分配这么多heap空间啦

如果编译器给忽略掉,这里填多少也就无所谓了。

lcofjp 发表于 2012-9-6 00:47:49

THE HEAP
The heap contains dynamic data allocated by the C function malloc (or one of its
relatives) or the C++ operator new.
If your application uses dynamic memory allocation, you should be familiar with:
● Linker segments used for the heap
● Allocating the heap size, which differs depending on which build interface you are
using
● Placing the heap segments in memory.
A heap is only included in the application if dynamic memory allocation is actually
used.

栈的大小基本也是不必操心的,编译器会最大限度的利用内存,实际没用到的内存基本都属于栈。

594832359 发表于 2012-9-7 22:08:54

lcofjp 发表于 2012-9-6 00:47 static/image/common/back.gif
THE HEAP
The heap contains dynamic data allocated by the C function malloc (or one of its
relatives) ...

原来内存可以用作栈。但是我用IAR仿真430单片机的时候,如果栈设置比较小,就会有栈超过90%的警告!
页: [1]
查看完整版本: 关于IAR使用的一个疑问!!!请教高手~