diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-16 19:11:07 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-16 19:11:07 +0000 |
commit | 9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f (patch) | |
tree | a4d2b47d47b30c9f7416757f798b092bf1ea6909 /include | |
parent | bdf44b929f6bd0983b0f0df0d2ae66610e81e149 (diff) |
Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Config/config.h.in | 3 | ||||
-rw-r--r-- | include/llvm/System/Program.h | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 2e9731e1a4..7a52010c68 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -124,6 +124,9 @@ /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE +/* Define to 1 if you have the `getrlimit' function. */ +#undef HAVE_GETRLIMIT + /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE diff --git a/include/llvm/System/Program.h b/include/llvm/System/Program.h index 3c9230c9e0..cef3805370 100644 --- a/include/llvm/System/Program.h +++ b/include/llvm/System/Program.h @@ -72,6 +72,10 @@ namespace sys { ///< expires, the child is killed and this call returns. If zero, ///< this function will wait until the child finishes or forever if ///< it doesn't. + unsigned memoryLimit = 0, ///< If non-zero, this specifies max. amount + ///< of memory can be allocated by process. If memory usage will be + ///< higher limit, the child is killed and this call returns. If zero - + ///< no memory limit. std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string ///< instance in which error messages will be returned. If the string ///< is non-empty upon return an error occurred while invoking the |