diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2007-03-05 05:22:08 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2007-03-05 05:22:08 +0000 |
commit | a531d04b648d8ff45a95662a009f13d74845e4ee (patch) | |
tree | 299515ec36a6429310fb52c5434b144beb7ce0af /llvm/lib/System/Win32/Win32.h | |
parent | 50bf51e8acaf5f44633e50a4c23f8b2ba29fdf55 (diff) | |
download | bcm5719-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.h | 21 |
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; + } +}; |