summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-02-03 20:24:25 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-02-03 20:24:25 -0500
commit54e7b5b846dfd542af3c8a904a57fc5ccc44ecb5 (patch)
tree622a3d1670e12426e16df9eedb75ff6ad8c3cda8
parente81e07594ca4863f9feb94c882b59ba7cc00a0ae (diff)
downloadSMAPI-54e7b5b846dfd542af3c8a904a57fc5ccc44ecb5.tar.gz
SMAPI-54e7b5b846dfd542af3c8a904a57fc5ccc44ecb5.tar.bz2
SMAPI-54e7b5b846dfd542af3c8a904a57fc5ccc44ecb5.zip
enable aggressive memory optimizations by default (#757)
The new approach should be safe, and no errors were reported so far by alpha testers.
-rw-r--r--docs/release-notes.md4
-rw-r--r--src/SMAPI.Mods.ErrorHandler/ModEntry.cs2
-rw-r--r--src/SMAPI/Framework/Logging/LogManager.cs2
-rw-r--r--src/SMAPI/Framework/Models/SConfig.cs2
-rw-r--r--src/SMAPI/SMAPI.config.json2
5 files changed, 5 insertions, 7 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index e54fd24b..9cea9fa9 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -9,11 +9,11 @@
## Upcoming release
* For players:
- * Added _aggressive memory optimization_ option. This is experimental and disabled by default; you can enable it in `smapi-internal/config.json` if you experience `OutOfMemoryException` crashes.
+ * Added more aggressive memory optimization which should eliminate many cases of `OutOfMemoryException` crashes.
* Fixed error running `install on Windows.bat` in very rare cases.
* For modders:
- * Fixed SMAPI toolkit defaulting the mod type to SMAPI if its `manifest.json` has neither `EntryDll` nor `ContentPackFor`. This only affects external tools, since SMAPI itself validates those fields separately.
+ * Fixed SMAPI toolkit defaulting the mod type incorrectly if a mod's `manifest.json` has neither `EntryDll` nor `ContentPackFor`. This only affects external tools, since SMAPI itself validates those fields separately.
## 3.9.1
Released 25 January 2021 for Stardew Valley 1.5.4 or later.
diff --git a/src/SMAPI.Mods.ErrorHandler/ModEntry.cs b/src/SMAPI.Mods.ErrorHandler/ModEntry.cs
index 2f6f1939..f543814e 100644
--- a/src/SMAPI.Mods.ErrorHandler/ModEntry.cs
+++ b/src/SMAPI.Mods.ErrorHandler/ModEntry.cs
@@ -30,7 +30,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler
LogManager logManager = core.GetType().GetField("LogManager", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(core) as LogManager;
if (logManager == null)
{
- this.Monitor.Log($"Can't access SMAPI's internal log manager. Error-handling patches won't be applied.", LogLevel.Error);
+ this.Monitor.Log("Can't access SMAPI's internal log manager. Error-handling patches won't be applied.", LogLevel.Error);
return;
}
diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs
index 5f191873..2c7be399 100644
--- a/src/SMAPI/Framework/Logging/LogManager.cs
+++ b/src/SMAPI/Framework/Logging/LogManager.cs
@@ -295,8 +295,6 @@ namespace StardewModdingAPI.Framework.Logging
// warnings
if (!settings.CheckForUpdates)
this.Monitor.Log("You disabled update checks, so you won't be notified of new SMAPI or mod updates. Running an old version of SMAPI is not recommended. You can undo this by reinstalling SMAPI.", LogLevel.Warn);
- if (settings.AggressiveMemoryOptimizations)
- this.Monitor.Log("You enabled aggressive memory optimizations. This is an experimental option which may cause errors or crashes. You can undo this by reinstalling SMAPI.", LogLevel.Warn);
if (!settings.RewriteMods)
this.Monitor.Log("You disabled rewriting broken mods, so many older mods may fail to load. You can undo this by reinstalling SMAPI.", LogLevel.Info);
if (!this.Monitor.WriteToConsole)
diff --git a/src/SMAPI/Framework/Models/SConfig.cs b/src/SMAPI/Framework/Models/SConfig.cs
index 382ae41f..4a80e34c 100644
--- a/src/SMAPI/Framework/Models/SConfig.cs
+++ b/src/SMAPI/Framework/Models/SConfig.cs
@@ -22,7 +22,7 @@ namespace StardewModdingAPI.Framework.Models
[nameof(VerboseLogging)] = false,
[nameof(LogNetworkTraffic)] = false,
[nameof(RewriteMods)] = true,
- [nameof(AggressiveMemoryOptimizations)] = false
+ [nameof(AggressiveMemoryOptimizations)] = true
};
/// <summary>The default values for <see cref="SuppressUpdateChecks"/>, to log changes if different.</summary>
diff --git a/src/SMAPI/SMAPI.config.json b/src/SMAPI/SMAPI.config.json
index 6a485cbd..a9e6f389 100644
--- a/src/SMAPI/SMAPI.config.json
+++ b/src/SMAPI/SMAPI.config.json
@@ -41,7 +41,7 @@ copy all the settings, or you may cause bugs due to overridden changes in future
/**
* Whether to enable more aggressive memory optimizations.
- * THIS IS EXPERIMENTAL AND MAY CAUSE ERRORS OR CRASHES.
+ * You can try disabling this if you get ObjectDisposedException errors.
*/
"AggressiveMemoryOptimizations": true,