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.
 */
相关推荐
Avan_菜菜21 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach10151 天前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB2 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao2 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220704 天前
如何搭建本地yum源(上)
运维
A小辣椒5 天前
TShark:Wireshark CLI 功能
linux
A小辣椒5 天前
TShark:基础知识
linux
AlfredZhao5 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci