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 //===----------------------------------------------------------------------===//
15 #include "llvm/System/Process.h"
17 //===----------------------------------------------------------------------===//
18 //=== WARNING: Implementation here must contain only Win32 specific code
19 //=== and must not be UNIX code
20 //===----------------------------------------------------------------------===//
25 // This function retrieves the page size using GetSystemInfo and is present
26 // solely so it can be called once in Process::GetPageSize to initialize the
27 // static variable PageSize.
28 inline unsigned GetPageSizeOnce() {
29 // NOTE: A 32-bit application running under WOW64 is supposed to use
30 // GetNativeSystemInfo. However, this interface is not present prior
31 // to Windows XP so to use it requires dynamic linking. It is not clear
32 // how this affects the reported page size, if at all. One could argue
33 // that LLVM ought to run as 64-bits on a 64-bit system, anyway.
36 return static_cast<unsigned>(info.dwPageSize);
40 Process::GetPageSize() {
41 static const unsigned PageSize = GetPageSizeOnce();
46 // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab