[libmicrohttpd] an optimalisation hint - less SRAM memory
From:
Martin Velek
Subject:
[libmicrohttpd] an optimalisation hint - less SRAM memory
Date:
Wed, 30 Jan 2013 12:11:44 +0100
Hello,
could be possible to change declarations for arrays of strings in the file reason_phrase.c?
Currently it is static const char * []. This places all strings into .rodata section and pointers to them into LMA of .text and also into .data in VMA.
E.g. for an ARM Cortex M3 (flash + SRAM) compiled with a arm-none-eabi-gcc static const char *one_hundred[] = { "Continue", "Switching Protocols", "Processing" };
Strings "Continue", "Switching Protocols", "Processing" are stored in flash. Also an array with pointers to strings is stored in flash. In addition, this array is copied into SRAM (+16 bytes). If you would change it to "static const char * const one_hundred[]" ... it would occupy only flash.