Merge pull request #9224 from s-hadinger/backlog_mem

Reduce memory usage of BackLog
This commit is contained in:
Theo Arends 2020-09-03 15:29:33 +02:00 committed by GitHub
commit e88e10fd0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -323,7 +323,7 @@ void CmndBacklog(void)
backlog.add(blcommand);
}
#else
backlog[backlog_index] = String(blcommand);
backlog[backlog_index] = blcommand;
backlog_index++;
if (backlog_index >= MAX_BACKLOG) backlog_index = 0;
#endif

View File

@ -339,6 +339,7 @@ void BacklogLoop(void) {
#else
backlog_mutex = true;
ExecuteCommand((char*)backlog[backlog_pointer].c_str(), SRC_BACKLOG);
backlog[backlog_pointer] = (const char*) nullptr; // force deallocation of the String internal memory
backlog_pointer++;
if (backlog_pointer >= MAX_BACKLOG) { backlog_pointer = 0; }
backlog_mutex = false;