Skip to content

Instantly share code, notes, and snippets.

@cdave1
Created May 14, 2019 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdave1/1484b197b60e443abae5e5e975572da3 to your computer and use it in GitHub Desktop.
Save cdave1/1484b197b60e443abae5e5e975572da3 to your computer and use it in GitHub Desktop.
#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