avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] measuring stack/heap usage


From: Christopher Harvey
Subject: Re: [avr-chat] measuring stack/heap usage
Date: Sun, 14 Mar 2010 14:27:28 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

Maybe this is an unrelated question, but this topic reminded me to ask:
Is there a way to ask the compiler to report the maximum stack height of a program? I know this is undecidable if there is recursion. Seems really relevant in the case of avrs, since the amount of heap space one can use depends on the amount of stack space used. (heap stack/collisions). I can't think of any way to decide how much heap space to use when I don't know how big the stack can get.

Thanks,
Chris

On 03/14/10 19:19, Daniel Otte wrote:
Hi Tobias,
my ciphers do not use the heap but the testing utils surrounding them do.
Some functions from avrlibc also use the heap
(http://www.nongnu.org/avr-libc/user-manual/malloc.html).

Even if not using the heap the stack can not use all RAM since some C constructs
may result in data put into .data or space allocated in the .bss segment.
You also would have to take care of IO-regisers in the memory map.

Tobias Schneider schrieb:
  
On Sun, 2010-03-14 at 23:29 +0100, Daniel Otte wrote:
    
So in turn the question appears "how far does the heap go?"
      
Well, do you use the heap at all? I would think twice before
implementing a library which uses the heap.

I don't think that any avr-libc library functions use the heap.

So if you don't use any malloc's in your code your heap will always be 0
bytes big.

Greetings,
Tobias



------------------------------------------------------------------------

_______________________________________________
AVR-chat mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-chat
    
  
_______________________________________________ AVR-chat mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/avr-chat


reply via email to

[Prev in Thread] Current Thread [Next in Thread]