Replies: 2 comments 2 replies
-
关闭 malloc hook |
Beta Was this translation helpful? Give feedback.
-
暂时解决了家人们。 `#ifndef skynet_malloc_h #include <stddef.h> #define _hook_skynet_malloc malloc #define _hook_skynet_calloc calloc #define _hook_skynet_realloc realloc #define _hook_skynet_free free #define _hook_skynet_posix_memalign posix_memalign #endif` |
Beta Was this translation helpful? Give feedback.
-
clib引入了skynet.h,直接用g++编译的没问题。
但加上-std=c++11以后会报下面这个错误,应该是malloc声明不匹配。
有什么好点办法可以解决呢,最好是可以不用动两边的源码。
/usr/include/stdlib.h:465:45: 错误:declaration of ‘void* malloc(size_t) throw ()’ has a different exception specifier
extern void malloc (size_t __size) __THROW attribute_malloc __wur;
^
In file included from /home/poa/server/common/skynet/skynet-src/skynet.h:4:0,
from /home/poa/server/game/csrc/ser_mymap.cpp:3:
/home/poa/server/common/skynet/skynet-src/skynet_malloc.h:6:23: 错误:从先前的声明‘void malloc(size_t)’
#define skynet_malloc malloc
Beta Was this translation helpful? Give feedback.
All reactions