diff options
author | Isaac Hier <isaachier@gmail.com> | 2017-11-05 12:53:07 -0500 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2020-12-19 18:52:40 -0800 |
commit | 11dc65c3c40618065ae48ccdb1e1548e339bff32 (patch) | |
tree | 793adb5e4cb81d84bedfaff84614f58281a42ca9 | |
parent | 6078fe40d9a5b829cbbadc6ec824163d6d9eda5b (diff) | |
download | gperftools-11dc65c3c40618065ae48ccdb1e1548e339bff32.tar.gz |
Fix config headers, add more unit tests
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | cmake/config.h.in | 18 | ||||
-rw-r--r-- | cmake/tcmalloc.h.in | 4 |
3 files changed, 23 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 401c57b..25dc13c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -686,6 +686,7 @@ set(tcmalloc_minimal_headers src/malloc_hook_mmap_linux.h src/malloc_hook_mmap_freebsd.h) add_library(tcmalloc_minimal + ${tcmalloc_cc} src/common.cc src/internal_logging.cc ${system_alloc_cc} @@ -716,4 +717,15 @@ if(BUILD_TESTING) src/tests/testutil.cc src/tests/testutil.h) target_link_libraries(tcmalloc_minimal_unittest PUBLIC tcmalloc_minimal) + + add_executable(tcmalloc_minimal_large_unittest + src/tests/tcmalloc_large_unittest.cc + src/tests/testutil.cc + src/tests/testutil.h) + target_link_libraries(tcmalloc_minimal_large_unittest PUBLIC tcmalloc_minimal) + + add_executable(tcmalloc_minimal_large_heap_fragmentation_unittest + src/tests/large_heap_fragmentation_unittest.cc) + target_link_libraries( + tcmalloc_minimal_large_heap_fragmentation_unittest PUBLIC tcmalloc_minimal) endif() diff --git a/cmake/config.h.in b/cmake/config.h.in index 4007f02..9dac54f 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -14,27 +14,27 @@ /* Define to 1 if you have the declaration of `cfree', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_CFREE +#cmakedefine01 HAVE_DECL_CFREE /* Define to 1 if you have the declaration of `memalign', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_MEMALIGN +#cmakedefine01 HAVE_DECL_MEMALIGN /* Define to 1 if you have the declaration of `posix_memalign', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_POSIX_MEMALIGN +#cmakedefine01 HAVE_DECL_POSIX_MEMALIGN /* Define to 1 if you have the declaration of `pvalloc', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_PVALLOC +#cmakedefine01 HAVE_DECL_PVALLOC /* Define to 1 if you have the declaration of `uname', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_UNAME +#cmakedefine01 HAVE_DECL_UNAME /* Define to 1 if you have the declaration of `valloc', and to 0 if you don't. */ -#cmakedefine HAVE_DECL_VALLOC +#cmakedefine01 HAVE_DECL_VALLOC /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H @@ -156,11 +156,11 @@ /* Define to 1 if compiler supports __thread */ #cmakedefine HAVE_TLS -#cmakedefine HAVE_DECL_SLEEP +#cmakedefine01 HAVE_DECL_SLEEP -#cmakedefine HAVE_DECL_NANOSLEEP +#cmakedefine01 HAVE_DECL_NANOSLEEP -#cmakedefine HAVE_DECL_BACKTRACE +#cmakedefine01 HAVE_DECL_BACKTRACE #cmakedefine HAVE_UNWIND_BACKTRACE diff --git a/cmake/tcmalloc.h.in b/cmake/tcmalloc.h.in index 3bffb6f..e75efd5 100644 --- a/cmake/tcmalloc.h.in +++ b/cmake/tcmalloc.h.in @@ -41,8 +41,8 @@ /* Define the version number so folks can check against it */ #define TC_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ #define TC_VERSION_MINOR @PROJECT_VERSION_MINOR@ -#define TC_VERSION_PATCH "@PROJECT_VERSION_PATCH@" -#define TC_VERSION_STRING "gperftools @TC_VERSION_MAJOR@.@TC_VERSION_MINOR@@TC_VERSION_PATCH@" +#define TC_VERSION_PATCH ".@PROJECT_VERSION_PATCH@" +#define TC_VERSION_STRING "gperftools @PROJECT_VERSION@" /* For struct mallinfo, if it's defined. */ #ifdef HAVE_STRUCT_MALLINFO |