[PATCH] D77902: [scudo][standalone] Work with -Werror=class-memaccess
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 11 07:59:28 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG612f23857f36: [scudo][standalone] Work with -Werror=class-memaccess (authored by cryptoad).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77902/new/
https://reviews.llvm.org/D77902
Files:
compiler-rt/lib/scudo/standalone/mutex.h
compiler-rt/lib/scudo/standalone/quarantine.h
compiler-rt/lib/scudo/standalone/stats.h
Index: compiler-rt/lib/scudo/standalone/stats.h
===================================================================
--- compiler-rt/lib/scudo/standalone/stats.h
+++ compiler-rt/lib/scudo/standalone/stats.h
@@ -58,7 +58,9 @@
public:
void initLinkerInitialized() {}
void init() {
- memset(this, 0, sizeof(*this));
+ LocalStats::init();
+ Mutex.init();
+ StatsList = {};
initLinkerInitialized();
}
Index: compiler-rt/lib/scudo/standalone/quarantine.h
===================================================================
--- compiler-rt/lib/scudo/standalone/quarantine.h
+++ compiler-rt/lib/scudo/standalone/quarantine.h
@@ -187,7 +187,12 @@
Cache.initLinkerInitialized();
}
void init(uptr Size, uptr CacheSize) {
- memset(this, 0, sizeof(*this));
+ CacheMutex.init();
+ Cache.init();
+ RecycleMutex.init();
+ MinSize = {};
+ MaxSize = {};
+ MaxCacheSize = {};
initLinkerInitialized(Size, CacheSize);
}
Index: compiler-rt/lib/scudo/standalone/mutex.h
===================================================================
--- compiler-rt/lib/scudo/standalone/mutex.h
+++ compiler-rt/lib/scudo/standalone/mutex.h
@@ -22,7 +22,7 @@
class HybridMutex {
public:
- void init() { memset(this, 0, sizeof(*this)); }
+ void init() { M = {}; }
bool tryLock();
NOINLINE void lock() {
if (LIKELY(tryLock()))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77902.256772.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200411/fec2cf47/attachment.bin>
More information about the llvm-commits
mailing list