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.
 */
相关推荐
毛驴赶鹿6 小时前
低配置服务器怎么搭建监控?Komari Docker部署与公网访问完整教程
运维·服务器·docker
Fu2067216 小时前
结课项目考试
linux·运维·服务器
MXsoft6186 小时前
## 信创运维2.0的“最后一公里”——国产设备“能用但不好用”,问题出在哪?
运维
Albert·Lin6 小时前
LVS相关知识点总结-一
linux·服务器·lvs
公众号:fuwuqiBMC7 小时前
(转自“服务器BMC”)服务器BMC芯片——AST1840
运维·服务器·fpga开发
测试专家7 小时前
PCI-1553B板卡在 Windows Server 2016 服务器安装流程详解
服务器·windows·单片机
忘路之远近i8 小时前
受够阿里云自带终端后,我用 Cursor + grill-me 做了个运维面板
服务器·开发语言·人工智能·python·阿里云·云计算
laboratory agent开发8 小时前
工具调用失败后怎么办?重试分层与降级回路的三种路线
服务器·前端·网络
tianyuanwo8 小时前
深入理解 Linux 启动救援模式与控制台选择:从 x86 的 tty0 到 ARM 的 ttyS0
linux·grub·救援系统
爱网络爱Linux8 小时前
RHCSA+RHCE 10.0全新升级!红帽Ansible自动化运维
运维·自动化·ansible·rhce认证·rhel1o·linux10·rhce10