You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.2 KiB

--- a/Source/bmalloc/bmalloc/DebugHeap.h
+++ a/Source/bmalloc/bmalloc/DebugHeap.h
@@ -53,7 +53,7 @@ private:
#endif
// This is the debug heap. We can use whatever data structures we like. It doesn't matter.
- size_t m_pageSize;
+ size_t m_pageSize { 0 };
std::mutex m_lock;
std::unordered_map<void*, size_t> m_sizeMap;
};
--- a/Source/bmalloc/bmalloc/IsoTLS.cpp
+++ a/Source/bmalloc/bmalloc/IsoTLS.cpp
@@ -68,7 +68,9 @@ IsoTLS* IsoTLS::ensureEntries(unsigned offset)
#if HAVE_PTHREAD_MACHDEP_H
pthread_key_init_np(tlsKey, destructor);
#else
- pthread_key_create(&s_tlsKey, destructor);
+ int error = pthread_key_create(&s_tlsKey, destructor);
+ if (error)
+ BCRASH();
s_didInitialize = true;
#endif
});
--- a/Source/bmalloc/bmalloc/VMAllocate.h
+++ a/Source/bmalloc/bmalloc/VMAllocate.h
@@ -56,8 +56,12 @@ namespace bmalloc {
inline size_t vmPageSize()
{
static size_t cached;
- if (!cached)
- cached = sysconf(_SC_PAGESIZE);
+ if (!cached) {
+ long pageSize = sysconf(_SC_PAGESIZE);
+ if (pageSize < 0)
+ BCRASH();
+ cached = pageSize;
+ }
return cached;
}