daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import core.memory;
  2.  
  3. void main()
  4. {
  5.     GC.disable();
  6.     doSomethingLatencySensitive();
  7.     GC.enable();
  8.  
  9.     // About to do lots of memory-hungry stuff
  10.     // so improve performance by reserving GC memory up front
  11.     GC.reserve(1024 * 1024 * 1024);
  12.     doSomethingMemoryHungry();
  13.     GC.minimize();
  14.  
  15.     message.sendToServer();
  16.     GC.collect(); // Might as well run GC while waiting
  17.     waitForResponseFromServer();
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top