From 78283aabb17a4eb98de2e33b77fd23441a8e87c3 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:05:05 +0200 Subject: [PATCH 1/7] doc: gcc handles duplicate literal strings --- doc/reference.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index 75c267dd35..2e687747f1 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -247,11 +247,14 @@ 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 +freeing heap for your application. + +This is no longer true since core-v2.7 (duplicate literal strings within +r/o memory are now handled by gcc): ~~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. +duplicate strings yourself.~~ There is one additional helper macro to make it easier to pass ``const PROGMEM`` strings to methods that take a ``__FlashStringHelper`` From 6d65b9e9ae4afca0fe1d221dc6b6c0c9b49b9eb6 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:08:51 +0200 Subject: [PATCH 2/7] markdown --- doc/reference.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index 2e687747f1..4207674141 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -249,12 +249,8 @@ 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. -This is no longer true since core-v2.7 (duplicate literal strings within -r/o memory are now handled by gcc): ~~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.~~ +This is no longer true since core-v2.7 (duplicate literal strings within r/o memory are now handled by gcc): +~~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.~~ There is one additional helper macro to make it easier to pass ``const PROGMEM`` strings to methods that take a ``__FlashStringHelper`` From 0f26b93a2f1bf66b5797de30a98751fafcf3cfed Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:13:24 +0200 Subject: [PATCH 3/7] ditto --- doc/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference.rst b/doc/reference.rst index 4207674141..1d1eb0524d 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -250,7 +250,7 @@ Arduino; placing read only data and strings in read only memory and freeing heap for your application. This is no longer true since core-v2.7 (duplicate literal strings within r/o memory are now handled by gcc): -~~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.~~ +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. There is one additional helper macro to make it easier to pass ``const PROGMEM`` strings to methods that take a ``__FlashStringHelper`` From c392f299cf34c0662ca1bc1a3579182fea398893 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:17:06 +0200 Subject: [PATCH 4/7] workaround --- doc/reference.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index 1d1eb0524d..c33969d800 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -249,8 +249,13 @@ 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. -This is no longer true since core-v2.7 (duplicate literal strings within r/o memory are now handled by gcc): -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. +In core version 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`` From 9c2777b0ecd5f25aaa3484a9b5ec95c6c421e41b Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:20:04 +0200 Subject: [PATCH 5/7] ditto --- doc/reference.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index c33969d800..eb31b2b105 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -249,12 +249,12 @@ 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. -In core version prior to 2.7, the important difference is that on the +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 +| 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 From b1021950fee37d8e46cc37801c71f155a2716049 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:21:37 +0200 Subject: [PATCH 6/7] ditto --- doc/reference.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index eb31b2b105..1c91d69474 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -254,8 +254,8 @@ 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. +:raw-html:`
` 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`` From fdc729bf5b85b92a86b66b1df3627dd1d1760528 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 16 Aug 2020 23:22:43 +0200 Subject: [PATCH 7/7] ditto# Please enter the commit message for your changes. Lines starting --- doc/reference.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/reference.rst b/doc/reference.rst index 1c91d69474..9551d9d035 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -254,8 +254,9 @@ 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. -:raw-html:`
` Starting from v2.7, this is no longer true: duplicate -literal strings within r/o memory are now handled. + +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``