Created
May 14, 2019 20:27
-
-
Save cdave1/1484b197b60e443abae5e5e975572da3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PRODUCTION_BUILD | |
#define SUPPRESS_LOGS | |
using System; | |
public class StringAllocTest { | |
public static void Main(string[] args) { | |
Random random = new Random(); | |
var variable_here_so_runtime_allocation_needed = random.Next(0, 1000000); | |
Log("HERE IS A VERY LONG STRING, AND IT MIGHT " + variable_here_so_runtime_allocation_needed + " BE SO LONG THAT HEAP MEMORY MUST BE ALLOCATED TO STORE IT OMG!"); //, false); | |
} | |
public static void Log(string message) { | |
#if !SUPPRESS_LOGS | |
#if PRODUCTION_BUILD | |
System.Console.WriteLine(message); | |
#endif | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment