summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Win32/Win32.h
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2007-03-05 05:22:08 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2007-03-05 05:22:08 +0000
commita531d04b648d8ff45a95662a009f13d74845e4ee (patch)
tree299515ec36a6429310fb52c5434b144beb7ce0af /llvm/lib/System/Win32/Win32.h
parent50bf51e8acaf5f44633e50a4c23f8b2ba29fdf55 (diff)
downloadbcm5719-llvm-a531d04b648d8ff45a95662a009f13d74845e4ee.tar.gz
bcm5719-llvm-a531d04b648d8ff45a95662a009f13d74845e4ee.zip
Implement memoryLimit on Windows.
llvm-svn: 34922
Diffstat (limited to 'llvm/lib/System/Win32/Win32.h')
-rw-r--r--llvm/lib/System/Win32/Win32.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/System/Win32/Win32.h b/llvm/lib/System/Win32/Win32.h
index 74406aec540..71f0be56ab2 100644
--- a/llvm/lib/System/Win32/Win32.h
+++ b/llvm/lib/System/Win32/Win32.h
@@ -34,3 +34,24 @@ inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) {
LocalFree(buffer);
return true;
}
+
+class AutoHandle {
+ HANDLE handle;
+
+public:
+ AutoHandle(HANDLE h) : handle(h) {}
+
+ ~AutoHandle() {
+ if (handle)
+ CloseHandle(handle);
+ }
+
+ operator HANDLE() {
+ return handle;
+ }
+
+ AutoHandle &operator=(HANDLE h) {
+ handle = h;
+ return *this;
+ }
+};
OpenPOWER on IntegriCloud