Commit e8252dd7 authored by James Sedgwick's avatar James Sedgwick Committed by Facebook Github Bot

move Arena, ThreadCachedArena, and Malloc to memory/

Summary: all memory/-destined components besides hphp includes

Reviewed By: yfeldblum, mzlee

Differential Revision: D6121822

fbshipit-source-id: 6c6214d84dcdefe4789ed5200399ae27203d6340
parent 44df8f56
...@@ -463,6 +463,10 @@ if (BUILD_TESTS) ...@@ -463,6 +463,10 @@ if (BUILD_TESTS)
DIRECTORY io/async/ssl/test/ DIRECTORY io/async/ssl/test/
TEST ssl_errors_test SOURCES SSLErrorsTest.cpp TEST ssl_errors_test SOURCES SSLErrorsTest.cpp
DIRECTORY memory/test/
TEST thread_cached_arena_test SOURCES ThreadCachedArenaTest.cpp
TEST arena_test SOURCES ArenaTest.cpp
DIRECTORY portability/test/ DIRECTORY portability/test/
TEST constexpr_test SOURCES ConstexprTest.cpp TEST constexpr_test SOURCES ConstexprTest.cpp
TEST libgen-test SOURCES LibgenTest.cpp TEST libgen-test SOURCES LibgenTest.cpp
...@@ -489,7 +493,6 @@ if (BUILD_TESTS) ...@@ -489,7 +493,6 @@ if (BUILD_TESTS)
DIRECTORY test/ DIRECTORY test/
TEST ahm_int_stress_test SOURCES AHMIntStressTest.cpp TEST ahm_int_stress_test SOURCES AHMIntStressTest.cpp
TEST arena_test SOURCES ArenaTest.cpp
TEST arena_smartptr_test SOURCES ArenaSmartPtrTest.cpp TEST arena_smartptr_test SOURCES ArenaSmartPtrTest.cpp
TEST array_test SOURCES ArrayTest.cpp TEST array_test SOURCES ArrayTest.cpp
TEST ascii_check_test SOURCES AsciiCaseInsensitiveTest.cpp TEST ascii_check_test SOURCES AsciiCaseInsensitiveTest.cpp
...@@ -594,7 +597,6 @@ if (BUILD_TESTS) ...@@ -594,7 +597,6 @@ if (BUILD_TESTS)
TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp
TEST string_test SOURCES StringTest.cpp TEST string_test SOURCES StringTest.cpp
TEST synchronized_test SOURCES SynchronizedTest.cpp TEST synchronized_test SOURCES SynchronizedTest.cpp
TEST thread_cached_arena_test SOURCES ThreadCachedArenaTest.cpp
TEST thread_cached_int_test SOURCES ThreadCachedIntTest.cpp TEST thread_cached_int_test SOURCES ThreadCachedIntTest.cpp
TEST thread_local_test SOURCES ThreadLocalTest.cpp TEST thread_local_test SOURCES ThreadLocalTest.cpp
TEST timeout_queue_test SOURCES TimeoutQueueTest.cpp TEST timeout_queue_test SOURCES TimeoutQueueTest.cpp
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <folly/Malloc.h> #include <folly/memory/Malloc.h>
#include <folly/portability/Config.h> #include <folly/portability/Config.h>
#if FOLLY_HAVE_CPLUS_DEMANGLE_V3_CALLBACK #if FOLLY_HAVE_CPLUS_DEMANGLE_V3_CALLBACK
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
#include <utility> #include <utility>
#include <folly/Hash.h> #include <folly/Hash.h>
#include <folly/Malloc.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/BitsFunctexcept.h> #include <folly/portability/BitsFunctexcept.h>
// When used in folly, assertions are not disabled. // When used in folly, assertions are not disabled.
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
#include <folly/FormatTraits.h> #include <folly/FormatTraits.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Malloc.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/BitsFunctexcept.h> #include <folly/portability/BitsFunctexcept.h>
//============================================================================= //=============================================================================
......
...@@ -27,8 +27,6 @@ lib_LTLIBRARIES = \ ...@@ -27,8 +27,6 @@ lib_LTLIBRARIES = \
follyincludedir = $(includedir)/folly follyincludedir = $(includedir)/folly
nobase_follyinclude_HEADERS = \ nobase_follyinclude_HEADERS = \
Arena.h \
Arena-inl.h \
Array.h \ Array.h \
Assume.h \ Assume.h \
AtomicBitSet.h \ AtomicBitSet.h \
...@@ -72,7 +70,6 @@ nobase_follyinclude_HEADERS = \ ...@@ -72,7 +70,6 @@ nobase_follyinclude_HEADERS = \
detail/GroupVarintDetail.h \ detail/GroupVarintDetail.h \
detail/IPAddress.h \ detail/IPAddress.h \
detail/IPAddressSource.h \ detail/IPAddressSource.h \
detail/MallocImpl.h \
detail/MemoryIdler.h \ detail/MemoryIdler.h \
detail/MPMCPipelineDetail.h \ detail/MPMCPipelineDetail.h \
detail/RangeCommon.h \ detail/RangeCommon.h \
...@@ -322,12 +319,16 @@ nobase_follyinclude_HEADERS = \ ...@@ -322,12 +319,16 @@ nobase_follyinclude_HEADERS = \
LockTraitsBoost.h \ LockTraitsBoost.h \
Logging.h \ Logging.h \
MacAddress.h \ MacAddress.h \
Malloc.h \
MapUtil.h \ MapUtil.h \
Math.h \ Math.h \
Memory.h \ Memory.h \
memory/Arena.h \
memory/Arena-inl.h \
memory/MallctlHelper.h \ memory/MallctlHelper.h \
memory/Malloc.h \
memory/ThreadCachedArena.h \
memory/UninitializedMemoryHacks.h \ memory/UninitializedMemoryHacks.h \
memory/detail/MallocImpl.h \
MicroSpinLock.h \ MicroSpinLock.h \
MicroLock.h \ MicroLock.h \
MoveWrapper.h \ MoveWrapper.h \
...@@ -434,7 +435,6 @@ nobase_follyinclude_HEADERS = \ ...@@ -434,7 +435,6 @@ nobase_follyinclude_HEADERS = \
test/SynchronizedTestLib.h \ test/SynchronizedTestLib.h \
test/SynchronizedTestLib-inl.h \ test/SynchronizedTestLib-inl.h \
test/TestUtils.h \ test/TestUtils.h \
ThreadCachedArena.h \
ThreadCachedInt.h \ ThreadCachedInt.h \
ThreadLocal.h \ ThreadLocal.h \
TimeoutQueue.h \ TimeoutQueue.h \
...@@ -562,6 +562,7 @@ libfolly_la_SOURCES = \ ...@@ -562,6 +562,7 @@ libfolly_la_SOURCES = \
detail/MemoryIdler.cpp \ detail/MemoryIdler.cpp \
detail/SocketFastOpen.cpp \ detail/SocketFastOpen.cpp \
MacAddress.cpp \ MacAddress.cpp \
memory/ThreadCachedArena.cpp \
portability/Dirent.cpp \ portability/Dirent.cpp \
portability/Fcntl.cpp \ portability/Fcntl.cpp \
portability/Libgen.cpp \ portability/Libgen.cpp \
...@@ -604,7 +605,6 @@ libfolly_la_SOURCES = \ ...@@ -604,7 +605,6 @@ libfolly_la_SOURCES = \
system/ThreadName.cpp \ system/ThreadName.cpp \
system/VersionCheck.cpp \ system/VersionCheck.cpp \
Subprocess.cpp \ Subprocess.cpp \
ThreadCachedArena.cpp \
TimeoutQueue.cpp \ TimeoutQueue.cpp \
Try.cpp \ Try.cpp \
Uri.cpp \ Uri.cpp \
...@@ -633,7 +633,7 @@ libfolly_la_SOURCES += \ ...@@ -633,7 +633,7 @@ libfolly_la_SOURCES += \
endif endif
if !HAVE_WEAK_SYMBOLS if !HAVE_WEAK_SYMBOLS
libfollybase_la_SOURCES += detail/MallocImpl.cpp libfollybase_la_SOURCES += memory/detail/MallocImpl.cpp
endif endif
if HAVE_BOOST_CONTEXT if HAVE_BOOST_CONTEXT
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
#include <folly/detail/MemoryIdler.h> #include <folly/detail/MemoryIdler.h>
#include <folly/Logging.h> #include <folly/Logging.h>
#include <folly/Malloc.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/concurrency/CacheLocality.h> #include <folly/concurrency/CacheLocality.h>
#include <folly/memory/MallctlHelper.h> #include <folly/memory/MallctlHelper.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/PThread.h> #include <folly/portability/PThread.h>
#include <folly/portability/SysMman.h> #include <folly/portability/SysMman.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/Foreach.h> #include <folly/Foreach.h>
#include <folly/Function.h> #include <folly/Function.h>
#include <folly/Malloc.h>
#include <folly/MicroSpinLock.h> #include <folly/MicroSpinLock.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/SharedMutex.h> #include <folly/SharedMutex.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/PThread.h> #include <folly/portability/PThread.h>
#include <folly/detail/StaticSingletonManager.h> #include <folly/detail/StaticSingletonManager.h>
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include <folly/experimental/JemallocNodumpAllocator.h> #include <folly/experimental/JemallocNodumpAllocator.h>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Malloc.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/memory/Malloc.h>
#include <glog/logging.h> #include <glog/logging.h>
namespace folly { namespace folly {
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include <folly/experimental/JemallocNodumpAllocator.h> #include <folly/experimental/JemallocNodumpAllocator.h>
#include <folly/Malloc.h>
#include <folly/io/IOBuf.h> #include <folly/io/IOBuf.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
TEST(JemallocNodumpAllocatorTest, Basic) { TEST(JemallocNodumpAllocatorTest, Basic) {
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Malloc.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/hash/SpookyHashV2.h> #include <folly/hash/SpookyHashV2.h>
#include <folly/io/Cursor.h> #include <folly/io/Cursor.h>
#include <folly/memory/Malloc.h>
using std::unique_ptr; using std::unique_ptr;
...@@ -791,7 +791,7 @@ void IOBuf::reserveSlow(uint64_t minHeadroom, uint64_t minTailroom) { ...@@ -791,7 +791,7 @@ void IOBuf::reserveSlow(uint64_t minHeadroom, uint64_t minTailroom) {
// - If using jemalloc, we can try to expand in place, avoiding a memcpy() // - If using jemalloc, we can try to expand in place, avoiding a memcpy()
// - If not using jemalloc and we don't have too much to copy, // - If not using jemalloc and we don't have too much to copy,
// we'll use realloc() (note that realloc might have to copy // we'll use realloc() (note that realloc might have to copy
// headroom + data + tailroom, see smartRealloc in folly/Malloc.h) // headroom + data + tailroom, see smartRealloc in folly/memory/Malloc.h)
// - Otherwise, bite the bullet and reallocate. // - Otherwise, bite the bullet and reallocate.
if (headroom() + tailroom() >= minHeadroom + minTailroom) { if (headroom() + tailroom() >= minHeadroom + minTailroom) {
uint8_t* newData = writableBuffer() + minHeadroom; uint8_t* newData = writableBuffer() + minHeadroom;
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <iterator> #include <iterator>
#include <type_traits> #include <type_traits>
#include <folly/Malloc.h>
#include <folly/io/IOBuf.h> #include <folly/io/IOBuf.h>
#include <folly/memory/Malloc.h>
namespace folly { namespace folly {
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <boost/random.hpp> #include <boost/random.hpp>
#include <folly/Malloc.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using folly::fbstring; using folly::fbstring;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Malloc.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/memory/Malloc.h>
namespace folly { namespace folly {
...@@ -243,4 +243,4 @@ struct IsArenaAllocator<SysArena> : std::true_type { }; ...@@ -243,4 +243,4 @@ struct IsArenaAllocator<SysArena> : std::true_type { };
} // namespace folly } // namespace folly
#include <folly/Arena-inl.h> #include <folly/memory/Arena-inl.h>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#pragma once #pragma once
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Malloc.h> #include <folly/memory/Malloc.h>
#include <stdexcept> #include <stdexcept>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
// includes and uses fbstring. // includes and uses fbstring.
#if defined(_GLIBCXX_USE_FB) && !defined(_LIBSTDCXX_FBSTRING) #if defined(_GLIBCXX_USE_FB) && !defined(_LIBSTDCXX_FBSTRING)
#include <folly/detail/MallocImpl.h> #include <folly/memory/detail/MallocImpl.h>
#include <folly/portability/BitsFunctexcept.h> #include <folly/portability/BitsFunctexcept.h>
#include <string> #include <string>
...@@ -98,7 +98,7 @@ __attribute__((__weak__)); ...@@ -98,7 +98,7 @@ __attribute__((__weak__));
#else // !defined(_LIBSTDCXX_FBSTRING) #else // !defined(_LIBSTDCXX_FBSTRING)
#include <folly/detail/MallocImpl.h> /* nolint */ #include <folly/memory/detail/MallocImpl.h> /* nolint */
#include <folly/portability/BitsFunctexcept.h> /* nolint */ #include <folly/portability/BitsFunctexcept.h> /* nolint */
#endif #endif
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/ThreadCachedArena.h> #include <folly/memory/ThreadCachedArena.h>
#include <memory> #include <memory>
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
#include <type_traits> #include <type_traits>
#include <folly/Arena.h>
#include <folly/Likely.h> #include <folly/Likely.h>
#include <folly/Synchronized.h> #include <folly/Synchronized.h>
#include <folly/ThreadLocal.h> #include <folly/ThreadLocal.h>
#include <folly/memory/Arena.h>
namespace folly { namespace folly {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/detail/MallocImpl.h> #include <folly/memory/detail/MallocImpl.h>
extern "C" { extern "C" {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/Arena.h> #include <folly/memory/Arena.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
*/ */
#include <folly/memory/MallctlHelper.h> #include <folly/memory/MallctlHelper.h>
#include <folly/Malloc.h>
#include <folly/init/Init.h> #include <folly/init/Init.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#ifdef FOLLY_HAVE_LIBJEMALLOC #ifdef FOLLY_HAVE_LIBJEMALLOC
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include <folly/ThreadCachedArena.h> #include <folly/memory/ThreadCachedArena.h>
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
......
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
#include <folly/Assume.h> #include <folly/Assume.h>
#include <folly/ConstexprMath.h> #include <folly/ConstexprMath.h>
#include <folly/FormatTraits.h> #include <folly/FormatTraits.h>
#include <folly/Malloc.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <folly/SmallLocks.h> #include <folly/SmallLocks.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/BitsFunctexcept.h> #include <folly/portability/BitsFunctexcept.h>
#include <folly/portability/Malloc.h> #include <folly/portability/Malloc.h>
#include <folly/portability/TypeTraits.h> #include <folly/portability/TypeTraits.h>
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
* @author: Marcelo Juchem <marcelo@fb.com> * @author: Marcelo Juchem <marcelo@fb.com>
*/ */
#include <folly/Arena.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/memory/Arena.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/Arena.h>
#include <folly/Foreach.h> #include <folly/Foreach.h>
#include <folly/Memory.h> #include <folly/Memory.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/memory/Arena.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <glog/logging.h> #include <glog/logging.h>
#include <folly/Arena.h>
#include <folly/String.h> #include <folly/String.h>
#include <folly/memory/Arena.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
using namespace folly; using namespace folly;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment