On Mon, 2012-05-14 at 12:03 -0600, Eduardo Silva wrote: > Dave, Zeus ??, what do you think ?
A few things here. > > On Thu, May 10, 2012 at 1:40 AM, Lauri Kasanen <[email protected]> wrote: > > On Wed, 9 May 2012 14:44:52 -0600 > > Eduardo Silva <[email protected]> wrote: > > > >> Hi, > >> > >> in my copy it saves 4KB, but.. this is a micro optimization and i > >> would suggest to let that kind of optimization to the compiler. > > > > The compiler can't do that. The code says each var needed 2 bytes, even > > though we only use 1 bit of each. Correct. However, by replacing short integers with a character we already cut the size of the structure in half (2 vs 1 bytes) and it is a good enough optimization. I tend to avoid using bitfields as it fits data into words and this is bad when dealing with endianness. There's really no gain here anyway, so I'd just label it as a char. - Davidlohr _______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
