Skip to content
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

Flash size reduction for mime-type #7311

Closed
wants to merge 1 commit into from

Conversation

s-hadinger
Copy link
Contributor

The current mime-type array is based on Entry structure with fixed size string that waste a lot of Flash space (~600 bytes):

struct Entry
{
  const char endsWith[16]; 
  const char mimeType[32];
};

I replaced with 2 arrays for suffix and mime-type, with PROGMEM strings.

I also added #define MIMETYPE_MINIMAL to reduce the footprint to mime-types that are strictly necessary: html, txt, gz

Overall this saves a little over 1kB for Tasmota.

* moving to 2 arrays for suffix and mime-type, with PROGMEM strings
* adding `#define MIMETYPE_MINIMAL` to reduce the footprint to
  mime-types that are strictly necessary
@d-a-v
Copy link
Collaborator

d-a-v commented May 18, 2020

Nice but it's an API breaking change.

@s-hadinger
Copy link
Contributor Author

Oh, if mimeTable[] is part of the API, I can put it back in a single array which would be API-compatible. Let me do the change.

@s-hadinger
Copy link
Contributor Author

Closed in favor of #7312

@s-hadinger s-hadinger closed this May 18, 2020
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.

None yet

2 participants