aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/Process.h
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-12-31 23:23:35 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-12-31 23:23:35 +0000
commit814afe91ccad0e5e1f767303d780fa0318fa5212 (patch)
tree9905492e5626775b81a12370475b4325f59b8e3e /include/llvm/Support/Process.h
parent02d75477cd9bed5acf46979869f041e7f9726200 (diff)
Flesh out a page size accessor in the new API.
Implement the old API in terms of the new one. This simplifies the implementation on Windows which can now re-use the self_process's once initialization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Process.h')
-rw-r--r--include/llvm/Support/Process.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Support/Process.h b/include/llvm/Support/Process.h
index 6b29f57fc1..15fa3763c9 100644
--- a/include/llvm/Support/Process.h
+++ b/include/llvm/Support/Process.h
@@ -89,7 +89,27 @@ class self_process : public process {
public:
virtual id_type get_id();
+ /// \name Process configuration (sysconf on POSIX)
+ /// @{
+
+ /// \brief Get the virtual memory page size.
+ ///
+ /// Query the operating system for this process's page size.
+ size_t page_size() const { return PageSize; };
+
+ /// @}
+
private:
+ /// \name Cached process state.
+ /// @{
+
+ /// \brief Cached page size, this cannot vary during the life of the process.
+ size_t PageSize;
+
+ /// @}
+
+ /// \brief Constructor, used by \c process::get_self() only.
+ self_process();
};