-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve FlashString portability (#2796)
This PR removes copy support from the FlashString library. Doing so simplifies the code, improves performance and portability to other compilers (e.g. clang). The FlashString library previously supported copies (references) like this:: ``` FlashString emptyString; FlashString stringCopy(FS("Inline string")); DEFINE_FSTR_DATA_LOCAL(flashHelloData, "Hello"); auto myCopy = flashHelloData; ``` These will now fail to compile. Copy construction and assignment has been explicitly deleted so avoid unintentional side-effects. Objects should always be passed by reference. This change has the additional benefit of catching pass-by-copy errors. These function/method templates have been fixed: - `fileSetContent` - `IFS::File::setAttribute` - `IFS::FileSystem::setUserAttribute` - `IFS::ArchiveStream::setUserAttribute`
- Loading branch information
Showing
4 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
Submodule FlashString
updated
20 files
+2 −2 | map.rst | |
+19 −43 | object.rst | |
+1 −20 | src/ObjectBase.cpp | |
+5 −5 | src/include/FlashString/Array.hpp | |
+7 −7 | src/include/FlashString/Map.hpp | |
+17 −65 | src/include/FlashString/Object.hpp | |
+3 −16 | src/include/FlashString/ObjectBase.hpp | |
+28 −8 | src/include/FlashString/String.hpp | |
+7 −7 | src/include/FlashString/Vector.hpp | |
+5 −231 | src/include/FlashString/config.hpp | |
+2 −2 | string.rst | |
+1 −1 | test/app/array.cpp | |
+5 −0 | test/app/custom.cpp | |
+1 −2 | test/app/data.cpp | |
+7 −0 | test/app/speed.cpp | |
+4 −18 | test/app/string.cpp | |
+0 −8 | todo.rst | |
+0 −22 | tools/genm.py | |
+9 −0 | upgrade.rst | |
+4 −9 | vector.rst |
Submodule IFS
updated
4 files
+1 −1 | src/UserRole.cpp | |
+1 −1 | src/include/IFS/FWFS/ArchiveStream.h | |
+4 −4 | src/include/IFS/File.h | |
+2 −2 | src/include/IFS/FileSystem.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters