[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Confusing static method RAM usage.
From: |
Georg-Johann Lay |
Subject: |
Re: [avr-gcc-list] Confusing static method RAM usage. |
Date: |
Sat, 17 Dec 2011 14:22:36 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.7 (Windows/20050923) |
Marcin S schrieb:
I never said this code does not compile.
It's text in square brackets. It describes the snipped-out text rather
then quoting all that lines.
using avr-gcc-4.5.3
build opts are:
avr-gcc -c -mmcu=atmega128 -x c++ -gdwarf-2 -DF_CPU=3686400UL -Os
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
-fno-exceptions -Wall -Wundef -ffunction-sections -fdata-sections
-Wa,-adhlns=OBJ/PanelPellet.lst -I. -IhrdDefs -ImyClasses -MMD -MP
-MF .dep/PanelPellet.o.d PanelPellet.cpp -o OBJ/PanelPellet.o
I prepared some related code snippets that should give You general
idea how its organized.
http://pastebin.com/96dWVww8
Yet, this example code compiling just fine and avr-size report 0 bytes
RAM used, just as it should.
yup, the code is compiled to
main:
.L2:
rjmp .L2
.size main, .-main
.global panelObj
.section .bss.panelObj,"aw",@nobits
.type panelObj, @object
.size panelObj, 1
panelObj:
.skip 1,0
So your memory leak is somewhere else, i.e. triggered by code you
snipped out.
Compile the code with -save-temps and read s-file carefully and you see
where the memory is needed.