Skip to content

RAM savings with http responseCodeStrings to progmem #1732

Closed
@ghost

Description

As I found a lot of strings in the webserver library, I tried to patch it to use progmem with F("") and returning a string. Is seems to work fine and saves 688 bytes of global RAM.

Just this code was changed:

String ESP8266WebServer::_responseCodeToString(int code) {
  switch (code) {
    case 100: return F("Continue");
    case 101: return F("Switching Protocols");
    case 200: return F("OK");
    case 201: return F("Created");
..
..

Don't know if this is the best approach, but would like to save RAM where possible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions