Skip to content

Wasn't sure where to ask for help, no one seemed to be in IRC #338

Closed Answered by adriweb
TheNuclearNexus asked this question in Q&A
Discussion options

You must be logged in to vote

Well you have too many globals (that go in the .bss section), apparently.

You should try not to use globals.

See here: https://ce-programming.github.io/toolchain/static/coding-guidelines.html#avoid-global-variables
and there: https://ce-programming.github.io/toolchain/static/faq.html#what-is-the-c-runtime-memory-layout

As you can see, the heap (memory for dynamic allocation, what malloc uses) and the bss (space for uninitialized static data, both variables and constants) share the same memory space, and is limited to around 61 KB.
If you go above that, well, you get this error message.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@commandblockguy
Comment options

@TheNuclearNexus
Comment options

@runer112
Comment options

@TheNuclearNexus
Comment options

@TheNuclearNexus
Comment options

Answer selected by mateoconlechuga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants