jemalloc 库的编译(Linux 下面)

1、从 github 上面下载源代码

2、解压到编译的目录里面去

3、安装 autoconf 工具链

4、执行 autogen.sh,成功(done)后就直接 make -j编译线程数

如果没有执行下面的配置语句编译出来的 jemalloc 库,是不能被其它程序链接C符号:je_malloc 函数的,因为它是通过连接器替换C标准库的 malloc、free 函数,但是一个程序之中可能会用到不同的分配器,最好的办法是这么配置编译环境。

./configure --with-jemalloc-prefix=je_

make -j

然后这样子也行

autogen.sh --with-jemalloc-prefix=je_

make -j

如果是 --with-jemalloc-prefix=je_ 编译的就需要增一个编译器定义宏

JEMALLOC_NO_DEMANGLE

该宏定义的说明:

cpp 复制代码
/*
 * The je_* macros can be used as stable alternative names for the
 * public jemalloc API if JEMALLOC_NO_DEMANGLE is defined.  This is primarily
 * meant for use in jemalloc itself, but it can be used by application code to
 * provide isolation from the name mangling specified via --with-mangling
 * and/or --with-jemalloc-prefix.
 */
相关推荐
风曦Kisaki8 小时前
Kubernetes(K8s)笔记Day07: StatefulSet 有状态控制器详解与使用案例
linux·docker·云原生·容器·kubernetes
不相心 -w-8 小时前
Cmake的基础用法
linux·开发语言·c++
深爱水瓶 血影S狂风8 小时前
Linux.NET学习手记(2)
linux·学习·.net
张文君8 小时前
docker registry 删除镜像
运维·docker·容器
爱喝水的鱼丶8 小时前
SAP-ABAP:调试器高级工具使用——内表分析、SQL追踪、内存检查功能实操
运维·sql·性能优化·sap·abap·经验交流
XiangrongZ8 小时前
debian中配置stm32的交叉编译环境
运维·stm32·debian
cuiyaonan20008 小时前
some weird issues regarding docker
运维·docker·容器
小π军8 小时前
计算机网络
服务器·计算机网络
sg_knight8 小时前
Codex CLI 安装全攻略:macOS / Linux / Windows(WSL2)三端实战
linux·windows·macos·openai·ai编程·coding·codex
大眼、不聚光9 小时前
9.linux系统管理-ssh免密配置
linux·ssh·github