forked from OSchip/llvm-project
Do not assume RLIM_INFINITY is always (rlim_t)-1in sanitizers code
Differential Revision: http://reviews.llvm.org/D5212 llvm-svn: 217308
This commit is contained in:
parent
dcb98e5dcc
commit
1827415be4
|
@ -69,7 +69,7 @@ void DisableCoreDumperIfNecessary() {
|
|||
|
||||
bool StackSizeIsUnlimited() {
|
||||
rlim_t stack_size = getlim(RLIMIT_STACK);
|
||||
return (stack_size == (rlim_t)-1);
|
||||
return (stack_size == RLIM_INFINITY);
|
||||
}
|
||||
|
||||
void SetStackSizeLimitInBytes(uptr limit) {
|
||||
|
@ -79,11 +79,11 @@ void SetStackSizeLimitInBytes(uptr limit) {
|
|||
|
||||
bool AddressSpaceIsUnlimited() {
|
||||
rlim_t as_size = getlim(RLIMIT_AS);
|
||||
return (as_size == (rlim_t)-1);
|
||||
return (as_size == RLIM_INFINITY);
|
||||
}
|
||||
|
||||
void SetAddressSpaceUnlimited() {
|
||||
setlim(RLIMIT_AS, -1);
|
||||
setlim(RLIMIT_AS, RLIM_INFINITY);
|
||||
CHECK(AddressSpaceIsUnlimited());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue