Flush memory cache

| | No TrackBacks

C++ code to do some sort of low-level memory operation in Windows.

{
  MEMORYSTATUS stat = {0};
  GlobalMemoryStatus (&stat);
  VOID* mem = VirtualAlloc (0,stat.dwAvailPhys,
    MEM_COMMIT,
    PAGE_READWRITE);

  // req to really alloc the pages
  memset (mem,0,stat.dwAvailPhys);
  VirtualFree (mem,0,MEM_RELEASE);
}

No TrackBacks

TrackBack URL: http://www.iwebthereforeiam.com/cgi-bin/mt/mt-tb.cgi/1040

Leave a comment

Verification (needed to reduce spam):

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.32-en

About this Entry

This page contains a single entry by Hugh Brown published on March 25, 2004 1:49 AM.

Signing a DLL was the previous entry in this blog.

RunAs is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.