enlarge filesystem buffer

This commit is contained in:
MichaelDvP
2021-10-14 18:37:52 +02:00
parent 235f789228
commit e4b73140c8
4 changed files with 10 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ class FSPersistence {
StatefulService<T> * statefulService, StatefulService<T> * statefulService,
FS * fs, FS * fs,
const char * filePath, const char * filePath,
size_t bufferSize = DEFAULT_BUFFER_SIZE) size_t bufferSize = FS_BUFFER_SIZE)
: _stateReader(stateReader) : _stateReader(stateReader)
, _stateUpdater(stateUpdater) , _stateUpdater(stateUpdater)
, _statefulService(statefulService) , _statefulService(statefulService)

View File

@@ -13,6 +13,10 @@
#define DEFAULT_BUFFER_SIZE 2048 #define DEFAULT_BUFFER_SIZE 2048
#endif #endif
#ifndef FS_BUFFER_SIZE
#define FS_BUFFER_SIZE 4096
#endif
enum class StateUpdateResult { enum class StateUpdateResult {
CHANGED = 0, // The update changed the state and propagation should take place if required CHANGED = 0, // The update changed the state and propagation should take place if required
UNCHANGED, // The state was unchanged, propagation should not take place UNCHANGED, // The state was unchanged, propagation should not take place

View File

@@ -12,7 +12,7 @@ class FSPersistence {
StatefulService<T> * statefulService, StatefulService<T> * statefulService,
FS * fs, FS * fs,
const char * filePath, const char * filePath,
size_t bufferSize = DEFAULT_BUFFER_SIZE) size_t bufferSize = FS_BUFFER_SIZE)
: _stateReader(stateReader) : _stateReader(stateReader)
, _stateUpdater(stateUpdater) , _stateUpdater(stateUpdater)
, _statefulService(statefulService) , _statefulService(statefulService)

View File

@@ -11,6 +11,10 @@
#define DEFAULT_BUFFER_SIZE 2048 #define DEFAULT_BUFFER_SIZE 2048
#endif #endif
#ifndef FS_BUFFER_SIZE
#define FS_BUFFER_SIZE 4096
#endif
enum class StateUpdateResult { enum class StateUpdateResult {
CHANGED = 0, // The update changed the state and propagation should take place if required CHANGED = 0, // The update changed the state and propagation should take place if required
UNCHANGED, // The state was unchanged, propagation should not take place UNCHANGED, // The state was unchanged, propagation should not take place