diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2018-01-04 17:05:04 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2018-01-04 17:05:04 +0000 |
commit | 541c5a079773e25fb09f80e8c9147bea1d32cd88 (patch) | |
tree | d0f2d6f0651b37b736ae6cda747dad2d0f7bd76b /compiler-rt | |
parent | dce4a9aa5901788722f1a063c204e93dacbc8be7 (diff) | |
download | bcm5719-llvm-541c5a079773e25fb09f80e8c9147bea1d32cd88.tar.gz bcm5719-llvm-541c5a079773e25fb09f80e8c9147bea1d32cd88.zip |
[scudo] s/unsigned long/size_t/ for __scudo_set_rss_limit
Summary:
`__scudo_set_rss_limit`'s `LimitMb` should really be a `size_t`. Update
accordingly the prototype. To avoid the `NOLINT` and conform with the other
Sanitizers, use the sanitizers types for the internal definition. This should
have no functional change.
Additionally, capitalize a variable name to follow the LLVM coding standards.
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D41704
llvm-svn: 321803
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/include/sanitizer/scudo_interface.h | 2 | ||||
-rw-r--r-- | compiler-rt/lib/scudo/scudo_allocator.cpp | 6 | ||||
-rw-r--r-- | compiler-rt/lib/scudo/scudo_interface_internal.h | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/compiler-rt/include/sanitizer/scudo_interface.h b/compiler-rt/include/sanitizer/scudo_interface.h index ec7a9e4e150..25979fb23a7 100644 --- a/compiler-rt/include/sanitizer/scudo_interface.h +++ b/compiler-rt/include/sanitizer/scudo_interface.h @@ -26,7 +26,7 @@ extern "C" { // the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit // can be removed by setting LimitMb to 0. This function's parameters should // be fully trusted to avoid security mishaps. - void __scudo_set_rss_limit(unsigned long LimitMb, int HardLimit); + void __scudo_set_rss_limit(size_t LimitMb, int HardLimit); #ifdef __cplusplus } // extern "C" #endif diff --git a/compiler-rt/lib/scudo/scudo_allocator.cpp b/compiler-rt/lib/scudo/scudo_allocator.cpp index e5a4d714c66..1329497f41a 100644 --- a/compiler-rt/lib/scudo/scudo_allocator.cpp +++ b/compiler-rt/lib/scudo/scudo_allocator.cpp @@ -721,8 +721,8 @@ uptr __sanitizer_get_unmapped_bytes() { return 1; } -uptr __sanitizer_get_estimated_allocated_size(uptr size) { - return size; +uptr __sanitizer_get_estimated_allocated_size(uptr Size) { + return Size; } int __sanitizer_get_ownership(const void *Ptr) { @@ -736,7 +736,7 @@ uptr __sanitizer_get_allocated_size(const void *Ptr) { // Interface functions extern "C" { -void __scudo_set_rss_limit(unsigned long LimitMb, int HardLimit) { // NOLINT +void __scudo_set_rss_limit(uptr LimitMb, s32 HardLimit) { if (!SCUDO_CAN_USE_PUBLIC_INTERFACE) return; Instance.setRssLimit(LimitMb, !!HardLimit); diff --git a/compiler-rt/lib/scudo/scudo_interface_internal.h b/compiler-rt/lib/scudo/scudo_interface_internal.h index 3f39e0c4ee0..7e8a12c834b 100644 --- a/compiler-rt/lib/scudo/scudo_interface_internal.h +++ b/compiler-rt/lib/scudo/scudo_interface_internal.h @@ -14,9 +14,14 @@ #ifndef SCUDO_INTERFACE_INTERNAL_H_ #define SCUDO_INTERFACE_INTERNAL_H_ +#include "sanitizer_common/sanitizer_internal_defs.h" + +using __sanitizer::uptr; +using __sanitizer::s32; + extern "C" { SANITIZER_INTERFACE_ATTRIBUTE -void __scudo_set_rss_limit(unsigned long LimitMb, int HardLimit); // NOLINT +void __scudo_set_rss_limit(uptr LimitMb, s32 HardLimit); } // extern "C" #endif // SCUDO_INTERFACE_INTERNAL_H_ |