Closed rh101 closed 1 year ago
It's by designed, once buffer used by entries(include duplicate) archive to curMapSize, will call flush to tidy entries, the duplicate entiries will removed and the map file used size will be decrease.
Fair enough, then this is a non-issue. Thank you for the clarification on how it works.
UserDefault::getInstance()->setFloatForKey("SettingName", 1);
multiple times. The "SettingName" config value will be written the same number of times to theUserDefault.bin
memory mapped file.It has nothing to do with the float value, but rather with the way the
setStringForKey
works. It doesn't check if the key already exists prior to writing it out to the memory mapped file.It doesn't actually cause any major issue except for constantly increasing the size of the
UserDefaults.bin
once it gets past each page size (4kbytes per page?). The reason it works fine is because the last value saved to the memory mapped file will always be the one used, so it's not a critical issue.