diff options
author | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-08-08 18:13:53 +0000 |
---|---|---|
committer | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2008-08-08 18:13:53 +0000 |
commit | 1cb8abac9401538b354d0694dfb3d42bc50fd987 (patch) | |
tree | 53ca0e3c8f883e01efcc8b5c41bbc16ac6b5ab6d /ACE/configure.ac | |
parent | ec6c3613cf67b2d71b8034278d75f29fce082d9b (diff) | |
download | ATCD-1cb8abac9401538b354d0694dfb3d42bc50fd987.tar.gz |
ChangeLogTag: Fri Aug 8 17:58:28 UTC 2008 J.T. Conklin <jtc@acorntoolworks.com>
Diffstat (limited to 'ACE/configure.ac')
-rw-r--r-- | ACE/configure.ac | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ACE/configure.ac b/ACE/configure.ac index 80084cf6926..9f16083c3c1 100644 --- a/ACE/configure.ac +++ b/ACE/configure.ac @@ -4871,12 +4871,28 @@ if test "$ace_user_enable_exceptions" = yes; then #include <limits> #endif +/* We already checked for ACE_LACKS_SYS_RESOURCE_H */ +#if !defined ACE_LACKS_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + int main(int, char *[]) { #if defined ACE_LACKS_NUMERIC_LIMITS const size_t ALLOC_SIZE = 2 * 1024 * 1024 * 1024; #else const size_t ALLOC_SIZE = std::numeric_limits<size_t>::max () / 2; #endif + +#if !defined (ACE_LACKS_RLIMIT) + /* set memory limit to the allocation size, so this test + should terminate on the first iteration. */ + struct rlimit rlimit; + if (getrlimit(RLIMIT_DATA, &rlimit) == 0) { + rlimit.rlim_cur = ALLOC_SIZE; + setrlimit(RLIMIT_DATA, &rlimit); + } +#endif + while (1) { try { char *a = new char[ALLOC_SIZE]; @@ -4928,12 +4944,29 @@ if test "$ace_user_enable_exceptions" = yes; then #include <limits> #endif +/* We already checked for ACE_LACKS_SYS_RESOURCE_H */ +#if !defined ACE_LACKS_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + + int main(int, char *[]) { #if defined ACE_LACKS_NUMERIC_LIMITS const size_t ALLOC_SIZE = 2 * 1024 * 1024 * 1024; #else const size_t ALLOC_SIZE = std::numeric_limits<size_t>::max () / 2; #endif + +#if !defined (ACE_LACKS_RLIMIT) + /* set memory limit to the allocation size, so this test + should terminate on the first iteration. */ + struct rlimit rlimit; + if (getrlimit(RLIMIT_DATA, &rlimit) == 0) { + rlimit.rlim_cur = ALLOC_SIZE; + setrlimit(RLIMIT_DATA, &rlimit); + } +#endif + while (1) { try { char *a = new char[ALLOC_SIZE]; |