[PATCH] D41704: [scudo] s/unsigned long/size_t/ for __scudo_set_rss_limit

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 09:06:15 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT321803: [scudo] s/unsigned long/size_t/ for __scudo_set_rss_limit (authored by cryptoad, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D41704?vs=128538&id=128619#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D41704

Files:
  include/sanitizer/scudo_interface.h
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_interface_internal.h


Index: lib/scudo/scudo_interface_internal.h
===================================================================
--- lib/scudo/scudo_interface_internal.h
+++ 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_
Index: lib/scudo/scudo_allocator.cpp
===================================================================
--- lib/scudo/scudo_allocator.cpp
+++ lib/scudo/scudo_allocator.cpp
@@ -721,8 +721,8 @@
   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 @@
 // 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);
Index: include/sanitizer/scudo_interface.h
===================================================================
--- include/sanitizer/scudo_interface.h
+++ include/sanitizer/scudo_interface.h
@@ -26,7 +26,7 @@
   // 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41704.128619.patch
Type: text/x-patch
Size: 1950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180104/c7c25057/attachment.bin>


More information about the llvm-commits mailing list