Skip to content

print_binary.cpp is linked/included unintentionally and bloats program #43

@joshgoebel

Description

@joshgoebel

Anytime ANY file in hb_utilities is referenced the entire folder gets compiled and linked. The linker is pretty good about throwing out what isn't used but I think because eventSerial is referenced in the main.cpp (internal to Arduino) that somehow the Serial stuff sticks in a bad way.

My code:

#include <click_counter.h>

Building:

Global variables use 195 bytes (19%) of dynamic memory,

With that line commented:

Global variables use 22 bytes (2%) of dynamic memory,

Note, I'm not even actually using any click_counter code in this example... the whole difference you are seeing is the extra Serial variable space that's getting added.

I'm not sure of anyway to fix this without putting each of the libraries into separate folders instead of having them all in the same folder. At the very least print_binary should be split off. I can do this and submit a pull request I just wasn't sure what direction I should go with fixing this. Or maybe you have a better idea?

I'm using Arduino 1.5.x but I'd guess the older IDE might exhibit the same behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions