Skip to content

Add support for allocating heap instead of stack memory #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MU-Software
Copy link

@MU-Software MU-Software commented Jan 9, 2022

The main purpose of this PR is to use this library in a special case with more heap space than stack.
ex) ESP32 can have external memory (PSRAM), but that can be used only for heap allocation.
Previously, using this library on a ESP32 without any modification causes a stack corruption.
(sizeof(struct datastream) might take 8901bytes(1+2+2+8896), and ESP32's default task stack size is 4 KB.)
We can solve the problem by moving some stack variables to heap.

This can be enabled by defining QUIRC_USE_HEAP macro,
define this before import, or add -D QUIRC_USE_HEAP flag while compiling.

This can be enabled by defining `QUIRC_USE_HEAP`.
Define this before import, or add `-D QUIRC_USE_HEAP` flag while compiling.
@dlbeer
Copy link
Owner

dlbeer commented Jan 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants