make Range::size() constexpr
[folly.git] / folly / Malloc.h
index 828c1b659ab8fd1487b3eb82b266c4aeabbb6eb6..e7616da53cbafd7cbc5b16e2610ccceadcd2714a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
 // Functions to provide smarter use of jemalloc, if jemalloc is being used.
 // http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html
 
-#ifndef FOLLY_MALLOC_H_
+#pragma once
 #define FOLLY_MALLOC_H_
 
 /**
@@ -116,7 +116,8 @@ namespace folly {
 #endif
 
 // Cannot depend on Portability.h when _LIBSTDCXX_FBSTRING.
-#ifdef __GNUC__
+// Disabled for nvcc because it fails on attributes on lambdas.
+#if defined(__GNUC__) && !defined(__NVCC__)
 #define FOLLY_MALLOC_NOINLINE __attribute__((__noinline__))
 #else
 #define FOLLY_MALLOC_NOINLINE
@@ -278,5 +279,3 @@ _GLIBCXX_END_NAMESPACE_VERSION
 } // folly
 
 #endif // !defined(_GLIBCXX_USE_FB) || defined(_LIBSTDCXX_FBSTRING)
-
-#endif // FOLLY_MALLOC_H_