title: Quickly close mmap discarding unflushed changes
body: <p>I am using an <code>mmap</code>'ed file as a virtual memory arena - the file is manually allocated because I want to control its location. On <code>munmap</code>, all the current contents of the buffers are flushed to the file, but I don't really need the file contents. Is it possible to simply discard the mmap area without write back?</p>
  
  <p>Linux-specific solutions are OK.</p>
  
  <p>I mean something like</p>
  
  <pre><code>char* myswaparea = "/tmp/myswaparea";
  int64_t len = 1LL &lt;&lt; 30;
  fd = open(myswaparea, O_CREAT|O_RDWR, 0600);
  ftruncate(fd, len);
  void* arena = mmap(NULL, len, .... fd ...);
  /* use arena */
  munmap(arena, len);  /* here comes an unnecessary flush */
  close(fd);
  unlink(myswaparea);
  </code></pre>