1 //===- Win32/Process.cpp - Win32 Process Implementation ------- -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Jeff Cohen and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides the Win32 specific implementation of the Process class.
12 //===----------------------------------------------------------------------===//
16 //===----------------------------------------------------------------------===//
17 //=== WARNING: Implementation here must contain only Win32 specific code
18 //=== and must not be UNIX code
19 //===----------------------------------------------------------------------===//
24 // This function retrieves the page size using GetSystemInfo and is present
25 // solely so it can be called once in Process::GetPageSize to initialize the
26 // static variable PageSize.
27 inline unsigned GetPageSizeOnce() {
28 // NOTE: A 32-bit application running under WOW64 is supposed to use
29 // GetNativeSystemInfo. However, this interface is not present prior
30 // to Windows XP so to use it requires dynamic linking. It is not clear
31 // how this affects the reported page size, if at all. One could argue
32 // that LLVM ought to run as 64-bits on a 64-bit system, anyway.
35 return static_cast<unsigned>(info.dwPageSize);
39 Process::GetPageSize() {
40 static const unsigned PageSize = GetPageSizeOnce();
45 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab