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.
 */
相关推荐
NPE~2 分钟前
自动化工具Drissonpage 保姆级教程(含xpath语法)
运维·后端·爬虫·自动化·网络爬虫·xpath·浏览器自动化
神梦流10 分钟前
GE 引擎的内存优化终局:静态生命周期分析指导下的内存分配与复用策略
linux·运维·服务器
凡人叶枫12 分钟前
C++中输入、输出和文件操作详解(Linux实战版)| 从基础到项目落地,避坑指南
linux·服务器·c语言·开发语言·c++
wdfk_prog18 分钟前
[Linux]学习笔记系列 -- [drivers][input]serio
linux·笔记·学习
xuhe234 分钟前
[全流程详细教程]Docker部署ClawBot, 使用GLM4.7, 接入TG Bot实现私人助理. 解决Docker Openclaw Permission Denied问题
linux·docker·ai·github·tldr
Lsir10110_1 小时前
【Linux】进程信号(下半)
linux·运维·服务器
skywalk81631 小时前
unbound dns解析出现问题,寻求解决之道
运维·服务器·dns·unbound
酉鬼女又兒1 小时前
零基础入门Linux指南:每天一个Linux命令_pwd
linux·运维·服务器
云飞云共享云桌面1 小时前
高性能图形工作站的资源如何共享给10个SolidWorks研发设计用
linux·运维·服务器·前端·网络·数据库·人工智能
skywalk81631 小时前
走近科学:unbound dns域名服务器自己本地解析出现问题,寻求解决之道
运维·服务器·dns·unbound