@azmeuk 
I fixed the compilation errors in https://github.com/cocos2d/cocos2d-x/pull/3321 .
Please update `SAFE_HEAP ` part in another PR. Thanks.