Duplication in Flash of Const Strings
Posted: Mon Jan 07, 2019 11:51 am
Hi,
Not sure this is totally the best forum for this but I wanted to see if anyone had a suggestion.
I have an include file with a bunch of const strings in it. Here is a snippet of that include file:
I include this numerous places. In looking at my memory map I observed that a separate copy of each string is being created for every file that includes it:
I located this while trying to reduce the size of my .bin file. While this isn't a huge deal I was interested to hear any suggestions to prevent it.
Thanks,
Don
Not sure this is totally the best forum for this but I wanted to see if anyone had a suggestion.
I have an include file with a bunch of const strings in it. Here is a snippet of that include file:
Code: Select all
#pragma once
#include <string>
using namespace std;
const string TypeKey = "type";
const string SpeedKey = "speed";
const string MaxSpeedKey = "maxSpeed";
Code: Select all
B S 3FFB5DA8 24 TypeKey
B S 3FFB69C8 24 TypeKey
B S 3FFB5AC0 24 TypeKey
B S 3FFB9B20 24 TypeKey
B S 3FFB60A8 24 TypeKey
B S 3FFB9330 24 TypeKey
B S 3FFB53CC 24 TypeKey
B S 3FFB6CCC 24 TypeKey
B S 3FFB72D8 24 TypeKey
B S 3FFB66C4 24 TypeKey
B S 3FFB96A4 24 TypeKey
B S 3FFB4D94 24 TypeKey
B S 3FFB50CC 24 TypeKey
B S 3FFB4788 24 TypeKey
B S 3FFB7668 24 TypeKey
B S 3FFB4A8C 24 TypeKey
B S 3FFB6FD8 24 TypeKey
B S 3FFB63C4 24 TypeKey
Thanks,
Don