Removed Debug

On some devices it looks like removing the System.println() statements from inside an 'if' clause whose condition is a constant (static constant Globals.scDebug) makes a memory saving. This would suggest the compiler does not propagate constants and prune unreachable code. However in the device of greatest interest debug removal has made no difference to the memory usage. Here the conditional clauses have been turned into comments that can be removed on a case-by-case basis otherwise the debug printing is too voluminous anyway.
This commit is contained in:
Philip Abbey
2024-01-21 17:53:37 +00:00
parent 62b8f0fccf
commit d9ecaf34ee
12 changed files with 173 additions and 403 deletions

View File

@ -22,9 +22,6 @@ using Toybox.Lang;
(:glance)
class Globals {
// Enable printing of messages to the debug console (don't make this a Property
// as the messages can't be read from a watch!)
static const scDebug = false;
static const scAlertTimeout = 2000; // ms
static const scTapTimeout = 1000; // ms
// Time to let the existing HTTP responses get serviced after a
@ -34,5 +31,5 @@ class Globals {
// an ErrorView.
static const scApiResume = 200; // ms
// Warn the user after fetching the menu if their watch is low on memory before the device crashes.
static const scLowMem = 0.95; // percent as a fraction.
static const scLowMem = 0.90; // percent as a fraction.
}