cmake_minimum_required(VERSION 3.12)
# Please note that cmake support is very preliminary. Autotools-based
# build is the only fully supported build for now.
# Based on configure.ac
project(gperftools VERSION 2.10.0 LANGUAGES C CXX
DESCRIPTION "Performance tools for C++"
HOMEPAGE_URL http://code.google.com/p/gperftools/)
# Update this value for every release!
set(TCMALLOC_SO_VERSION 9.10.5)
set(PROFILER_SO_VERSION 5.5.5)
set(TCMALLOC_AND_PROFILER_SO_VERSION 10.5.6)
# The user can choose not to compile in the heap-profiler, the
# heap-checker, or the cpu-profiler. There's also the possibility
# for a 'fully minimal' compile, which leaves out the stacktrace
# code as well. By default, we include all of these that the
# target system supports.
set(DEFAULT_BUILD_CPU_PROFILER ON)
set(DEFAULT_BUILD_HEAP_PROFILER ON)
set(DEFAULT_BUILD_HEAP_CHECKER ON)
set(DEFAULT_BUILD_DEBUGALLOC ON)
set(DEFAULT_BUILD_MINIMAL OFF)
set(DEFAULT_TCMALLOC_ALIGNMENT 16)
set(NEED_NANOSLEEP ON) # Used later, to decide if to run ACX_NANOSLEEP
set(HOST string(TOLOWER "${CMAKE_SYSTEM_NAME}"))
if(MINGW OR MSVC)
set(DEFAULT_BUILD_MINIMAL ON)
set(DEFAULT_BUILD_DEBUGALLOC OFF)
set(NEED_NANOSLEEP OFF)
elseif(CYGWIN)
set(DEFAULT_BUILD_HEAP_CHECKER OFF)
set(DEFAULT_BUILD_CPU_PROFILER OFF)
elseif(HOST MATCHES "freebsd")
set(DEFAULT_BUILD_HEAP_CHECKER OFF)
elseif(APPLE)
set(DEFAULT_BUILD_HEAP_CHECKER OFF)
endif()
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CheckVariableExists)
include(CMakeDependentOption)
include(CTest)
include(CPack)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(DefineTargetVariables)
include(FindObjcopyWithWeaken)
include(PCFromUContext)
define_target_variables()
# Currently only backtrace works on s390.
if(s390 OR OSX)
set(default_enable_libunwind OFF)
set(default_enable_backtrace ON)
else()
set(default_enable_libunwind ON)
set(default_enable_backtrace OFF)
endif()
# Disable libunwind linking on ppc64 by default.
if(PPC64)
set(default_enable_libunwind OFF)
set(default_tcmalloc_pagesize 64)
else()
set(default_enable_libunwind ON)
set(default_tcmalloc_pagesize 8)
endif()
cmake_dependent_option(
GPERFTOOLS_BUILD_CPU_PROFILER "Build cpu-profiler" ${DEFAULT_BUILD_CPU_PROFILER}
"NOT gperftools_build_minimal" OFF)
cmake_dependent_option(
GPERFTOOLS_BUILD_HEAP_PROFILER "Build heap-profiler" ${DEFAULT_BUILD_HEAP_PROFILER}
"NOT gperftools_build_minimal" OFF)
cmake_dependent_option(
GPERFTOOLS_BUILD_HEAP_CHECKER "Build heap-checker" ${DEFAULT_BUILD_HEAP_CHECKER}
"NOT gperftools_build_minimal" OFF)
cmake_dependent_option(
GPERFTOOLS_BUILD_DEBUGALLOC "Build debugalloc" ${DEFAULT_BUILD_DEBUGALLOC}
"NOT gperftools_build_minimal" OFF)
option(
gperftools_build_minimal
"Build only tcmalloc-minimal (and maybe tcmalloc-minimal-debug)"
${DEFAULT_BUILD_MINIMAL})
if(gperftools_build_minimal)
set(GPERFTOOLS_BUILD_CPU_PROFILER OFF)
set(GPERFTOOLS_BUILD_HEAP_PROFILER OFF)
set(GPERFTOOLS_BUILD_HEAP_CHECKER OFF)
endif()
cmake_dependent_option(
gperftools_build_benchmark "Build benchmark" ON "NOT MINGW AND NOT MSVC" OFF)
option(gperftools_enable_stacktrace_via_backtrace
"Enable use of backtrace() for stacktrace capturing (may deadlock)"
${default_enable_backtrace})
option(gperftools_enable_libunwind
"Enable libunwind linking"
${default_enable_libunwind})
set(enable_backtrace ${gperftools_enable_stacktrace_via_backtrace})
set(enable_libunwind ${gperftools_enable_libunwind})
set(gperftools_tcmalloc_pagesize ${default_tcmalloc_pagesize}
CACHE STRING "Set the tcmalloc internal page size")
set_property(CACHE gperftools_tcmalloc_pagesize PROPERTY STRINGS "8" "32" "64")
if(NOT gperftools_tcmalloc_pagesize STREQUAL "8" AND
NOT gperftools_tcmalloc_pagesize STREQUAL "32" AND
NOT gperftools_tcmalloc_pagesize STREQUAL "64")
message(WARNING
"Invalid gperftools_tcmalloc_pagesize (${gperftools_tcmalloc_pagesize}), "
"setting to default value (${default_tcmalloc_pagesize})")
set(gperftools_tcmalloc_pagesize ${default_tcmalloc_pagesize})
endif()
if (gperftools_tcmalloc_pagesize STREQUAL "32" OR
gperftools_tcmalloc_pagesize STREQUAL "64")
set(TCMALLOC_${gperftools_tcmalloc_pagesize}K_PAGES ON)
endif()
set(gperftools_tcmalloc_alignment ${DEFAULT_TCMALLOC_ALIGNMENT}
CACHE STRING "Set the tcmalloc allocation alignment")
set_property(CACHE gperftools_tcmalloc_alignment PROPERTY STRINGS "8" "16")
if(NOT gperftools_tcmalloc_alignment STREQUAL "8" AND
NOT gperftools_tcmalloc_alignment STREQUAL "16")
message(WARNING
"Invalid gperftools_tcmalloc_alignment (${gperftools_tcmalloc_alignment}), "
"setting to default value (${DEFAULT_TCMALLOC_ALIGNMENT})")
set(gperftools_tcmalloc_alignment ${DEFAULT_TCMALLOC_ALIGNMENT})
endif()
if(gperftools_tcmalloc_alignment STREQUAL "8")
set(TCMALLOC_ALIGN_8BYTES ON)
endif()
# AX_CXX_COMPILE_STDCXX(11, ext, mandatory)
if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(CMAKE_CXX_STANDARD 17) # std::align_val_t
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
# Check if we have an objcopy installed that supports -W
find_objcopy_with_weaken()
# AX_C___ATTRIBUTE__
check_c_source_compiles("#include <stdlib.h>
static void foo(void) __attribute__ ((unused));
void foo(void) { exit(1); }
int main() { return 0; }"
HAVE___ATTRIBUTE__)
set(CMAKE_EXTRA_INCLUDE_FILES "malloc.h")
check_type_size("struct mallinfo" STRUCT_MALLINFO LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES "elf.h")
check_type_size("Elf32_Versym" ELF32_VERSYM LANGUAGE CXX) # for vdso_support.h
set(CMAKE_EXTRA_INCLUDE_FILES)
check_function_exists("sbrk" HAVE_SBRK) # for tcmalloc to get memory
check_function_exists("__sbrk" HAVE_SBRK) # for tcmalloc to get memory
check_function_exists("geteuid" HAVE_GETEUID) # for turning off services when run as root
check_function_exists("fork" HAVE_FORK) # for the pthread_atfork setup
check_include_file("features.h" HAVE_FEATURES_H) # for vdso_support.h, Where __GLIBC__ is defined
check_include_file("malloc.h" HAVE_MALLOC_H) # some systems define stuff there, others not
check_include_file("glob.h" HAVE_GLOB_H) # for heap-profile-table (cleaning up profiles)
check_include_file("execinfo.h" HAVE_EXECINFO_H) # for stacktrace? and heapchecker_unittest
check_include_file("unwind.h" HAVE_UNWIND_H) # for stacktrace
check_include_file("sched.h" HAVE_SCHED_H) # for being nice in our spinlock code
check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H) # for thread_lister (needed by leak-checker)
check_include_file("linux/ptrace.h" HAVE_LINUX_PTRACE_H) # also needed by leak-checker
check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) # optional; for forking out to symbolizer
check_include_file("sys/wait.h" HAVE_SYS_WAIT_H) # optional; for forking out to symbolizer
check_include_file("poll.h" HAVE_POLL_H) # optional; for forking out to symbolizer
check_include_file("fcntl.h" HAVE_FCNTL_H) # for tcmalloc_unittest
check_include_file("grp.h" HAVE_GRP_H) # for heapchecker_unittest
check_include_file("pwd.h" HAVE_PWD_H) # for heapchecker_unittest
check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H) # for memalign_unittest.cc
check_include_file("sys/cdefs.h" HAVE_SYS_CDEFS_H) # Where glibc defines __THROW
check_include_file("unistd.h" HAVE_UNISTD_H)
check_include_file("inttypes.h" HAVE_INTTYPES_H)
# We also need <ucontext.h>/<sys/ucontext.h>, but we get those from
# AC_PC_FROM_UCONTEXT, below.
# We override a lot of memory allocation routines, not all of which are
# standard. For those the system doesn
没有合适的资源?快使用搜索试试~ 我知道了~
Tcmalloc-v2.10
需积分: 1 2 下载量 18 浏览量
2023-03-04
11:54:53
上传
评论
收藏 1.54MB GZ 举报
温馨提示
共340个文件
h:109个
cc:84个
png:22个
tcmalloc 内存管理及内存泄漏
资源推荐
资源详情
资源评论
收起资源包目录
Tcmalloc-v2.10 (340个子文件)
pprof.1 3KB
configure.ac 28KB
Makefile.am 68KB
shortproc.asm 4KB
AUTHORS 35B
nm-pdb.c 9KB
addr2line-pdb.c 6KB
malloc_extension_c_test.c 6KB
run_benchmark.c 3KB
thread_lister.c 3KB
dynamic_annotations.c 2KB
ia32_opcode_map.cc 111KB
heap-checker.cc 98KB
tcmalloc.cc 78KB
debugallocation.cc 58KB
tcmalloc_unittest.cc 52KB
heap-checker_unittest.cc 48KB
patch_functions.cc 46KB
memory_region_map.cc 34KB
sysinfo.cc 32KB
preamble_patcher.cc 29KB
malloc_hook.cc 26KB
linuxthreads.cc 25KB
page_heap.cc 24KB
low_level_alloc.cc 23KB
heap-profiler.cc 22KB
sampler_test.cc 22KB
heap-profile-table.cc 20KB
profiledata_unittest.cc 20KB
system-alloc.cc 19KB
profile-handler.cc 19KB
thread_cache.cc 18KB
mini_disassembler.cc 16KB
profiler.cc 15KB
elf_mem_image.cc 14KB
preamble_patcher_test.cc 14KB
preamble_patcher_with_stub.cc 13KB
stacktrace.cc 13KB
malloc_extension.cc 12KB
profile-handler_unittest.cc 12KB
central_freelist.cc 12KB
malloc_hook_test.cc 12KB
debugallocation_test.cc 12KB
symbolize.cc 11KB
common.cc 10KB
stacktrace_unittest.cc 10KB
memfs_malloc.cc 10KB
port.cc 10KB
profiledata.cc 9KB
malloc_bench.cc 9KB
testutil.cc 8KB
system-alloc.cc 7KB
memalign_unittest.cc 7KB
low_level_alloc_unittest.cc 6KB
emergency_malloc.cc 6KB
maybe_threads.cc 6KB
addressmap_unittest.cc 6KB
page_heap_test.cc 6KB
pagemap_unittest.cc 6KB
internal_logging.cc 6KB
static_vars.cc 6KB
atomicops_unittest.cc 5KB
heap-profiler_unittest.cc 5KB
system-alloc_unittest.cc 5KB
vdso_support.cc 5KB
spinlock.cc 5KB
ia32_modrm_map.cc 5KB
sampler.cc 5KB
override_functions.cc 5KB
profiler_unittest.cc 5KB
frag_unittest.cc 5KB
tcmalloc_large_unittest.cc 5KB
getpc_test.cc 5KB
markidle_unittest.cc 4KB
malloc_extension_test.cc 4KB
spinlock_internal.cc 4KB
atomicops-internals-x86.cc 4KB
realloc_unittest.cc 4KB
heap-checker-bcad.cc 4KB
stack_trace_table.cc 4KB
logging.cc 4KB
get_mangled_names.cc 3KB
sampling_test.cc 3KB
thread_dealloc_unittest.cc 3KB
span.cc 3KB
stack_trace_table_test.cc 3KB
simple_compat_test.cc 3KB
binary_trees.cc 3KB
current_allocated_bytes_test.cc 3KB
packed-cache_test.cc 3KB
raw_printer.cc 2KB
large_heap_fragmentation_unittest.cc 2KB
emergency_malloc_for_stacktrace.cc 2KB
raw_printer_test.cc 2KB
fake_stacktrace_scope.cc 2KB
ChangeLog 442KB
changelog 5KB
PCFromUContext.cmake 3KB
FindObjcopyWithWeaken.cmake 2KB
DefineTargetVariables.cmake 751B
共 340 条
- 1
- 2
- 3
- 4
资源评论
leo_hello66
- 粉丝: 43
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 原生微信小程序源码 - -滴滴公交-查公交
- 人工智能实验四 感知器算法的设计实现
- java小项目多线程多线程 复制文件 冒泡排序 群聊
- 四数之和(java代码).docx
- 701837906919458TapScanner v3.0.10 (Pro).apk
- 青岛大学人工智能实验二 利用α-β搜索的博弈树算法编写一字棋游戏
- ### 1、项目介绍 本项目Scrapy进行数据爬取,并使用Django框架+PyEcharts实现可视化大屏 效果如下:
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 289ssm-mysql-jsp 计算机课程实验管理系统.zip(可运行源码+数据库文件+文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功