2013-07-17

使用 jemalloc 编译过程出错的问题

Views: 20506 | Add Comments

使用 jemalloc, 编译过程出现如下报错:

/usr/include/stdlib.h:589: 错误:‘void* malloc(size_t) throw ()’ 的声明抛出不同的异常
/usr/include/stdlib.h:592: 错误:‘void* calloc(size_t, size_t) throw ()’ 的声明抛出不同的异常
/usr/include/stdlib.h:601: 错误:‘void* realloc(void*, size_t) throw ()’ 的声明抛出不同的异常
/usr/include/stdlib.h:603: 错误:‘void free(void*) throw ()’ 的声明抛出不同的异常
/usr/include/stdlib.h:617: 错误:‘void* valloc(size_t) throw ()’ 的声明抛出不同的异常

再看 jemalloc 的 manpage, 原来, 是必须在 include jemalloc 之前先 include stdlib.h.

#include <stdlib.h>
#include <jemalloc/jemalloc.h>

Related posts:

  1. SSDB 使用 jemalloc
  2. Libevent 2 HTTP 客户端示例
  3. 小心 int 乘法溢出!
  4. iOS 正确接收 HTTP chunked 数据的方法
  5. 关于 C++ 中的函数指针
Posted by ideawu at 2013-07-17 13:54:15

Leave a Comment