From f42327da349f5cf958f01b8ec35ffa05c80d6a05 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Mon, 17 Aug 2020 02:43:15 +0200 Subject: [PATCH] doc: gcc handles duplicate literal strings (#7531) --- doc/reference.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index 75c267dd3..9551d9d03 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -247,12 +247,17 @@ Progmem The Program memory features work much the same way as on a regular Arduino; placing read only data and strings in read only memory and -freeing heap for your application. The important difference is that on -the ESP8266 the literal strings are not pooled. This means that the same -literal string defined inside a ``F("")`` and/or ``PSTR("")`` will take -up space for each instance in the code. So you will need to manage the +freeing heap for your application. + +In core versions prior to 2.7, the important difference is that on the +ESP8266 the literal strings are not pooled. This means that the same +literal string defined inside a ``F("")`` and/or ``PSTR("")`` will take up +space for each instance in the code. So you will need to manage the duplicate strings yourself. +Starting from v2.7, this is no longer true: duplicate literal strings within +r/o memory are now handled. + There is one additional helper macro to make it easier to pass ``const PROGMEM`` strings to methods that take a ``__FlashStringHelper`` called ``FPSTR()``. The use of this will help make it easier to pool