Support setting thread name via std::thread::id
[folly.git] / folly / Malloc.h
index 3aeb765c2cca357f69aa1637beea4fc46cb3fbc5..4ed53ddda1c08499e7821d60ce9453872c50d703 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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;