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.
 */
相关推荐
海天鹰12 小时前
【免费】PHP主机=域名+解析+主机
服务器
DianSan_ERP12 小时前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
哇哈哈202113 小时前
信号量和信号
linux·c++
呉師傅13 小时前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
不是二师兄的八戒13 小时前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
芝士雪豹只抽瑞克五13 小时前
Nginx 高性能Web服务器笔记
服务器·nginx
失重外太空啦13 小时前
Tomcat
java·服务器·tomcat
zhangfeng113313 小时前
趋动云 如何ssh登录 服务区 项目server
运维·人工智能·ssh
一个人旅程~14 小时前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑
Henry Zhu12314 小时前
数据库:并发控制基本概念
服务器·数据库