Fix some implicit truncation and implicit sign coersion warnings in the Windows porta...
[folly.git] / folly / Malloc.h
index 3aeb765c2cca357f69aa1637beea4fc46cb3fbc5..5ff516bd3c1d11a1a9c648706c1b80614ee7d962 100644 (file)
@@ -179,7 +179,7 @@ FOLLY_MALLOC_NOINLINE inline bool usingJEMalloc() noexcept {
     // Static because otherwise clever compilers will find out that
     // the ptr is not used and does not escape the scope, so they will
     // just optimize away the malloc.
-    static void* ptr = malloc(1);
+    static const void* ptr = malloc(1);
     if (!ptr) {
       // wtf, failing to allocate 1 byte
       return false;