[apps/code] Remove EditorController::m_areaBuffer

This was a very large buffer that took a lot of RAM space (the size of
the storage). Instead of having it, we just move the available space of
the storage at the end of the edited script, and move it back when the
edition finishes.
This is slower but saves a lot of space.
This commit is contained in:
Léa Saviot
2019-12-03 14:36:52 +01:00
parent a2a0abdcef
commit 5853e96947
7 changed files with 51 additions and 29 deletions

View File

@@ -38,7 +38,7 @@ void ScriptStore::scanScriptsForFunctionsAndVariables(void * context, ScanCallba
// Handle lexer or parser errors with nlr.
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
const char * scriptContent = scriptAtIndex(scriptIndex).readContent();
const char * scriptContent = scriptAtIndex(scriptIndex).scriptContent();
if (scriptContent == nullptr) {
continue;
}
@@ -120,7 +120,7 @@ const char * ScriptStore::contentOfScript(const char * name) {
if (script.isNull()) {
return nullptr;
}
return script.readContent();
return script.scriptContent();
}
Script::ErrorStatus ScriptStore::addScriptFromTemplate(const ScriptTemplate * scriptTemplate) {