avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] sorry


From: Steve Franks
Subject: [avr-chat] sorry
Date: Mon, 7 Aug 2006 14:47:54 -0700

I'm feeling like the squeaky wheel lately.  Maybe someone could come along asking some 'easy' questions, then I'd be qualified to answer and 'give back' to the list ;)

Today's facinating question is this:  I take a class with a 'sizeof' of 44. I have an array of pointers to said classes.  If I remove one of them (both the instance and the pointer) and rebuild, I get a change of 56 bytes in .data, and 44 bytes in .bss.  So each one of these things chews up 100 bytes even in my not too big ram.  Thoughts on what I could be doing to confuse the compiler?  Constructor does initialize all variables (from what should be const's), would this be the culprt? The header file looks like an item that should go in .bss, but the .cpp looks like .data?

Suspicion: what is the ramification of saying:

struct test
{
   uint8_t x;
   test() : x(0) {}
};

vs.

struct test
{
   uint8_t x;
   test() { x=0; }
};

?

Steve

--
Steve Franks, KE7BTE
Staff Engineer
La Palma Devices, LLC
http://www.lapalmadevices.com
(520) 312-0089
reply via email to

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