acl/lib_acl_cpp/include/acl_cpp/stdlib/malloc.hpp

46 lines
1.0 KiB
C++
Raw Normal View History

#pragma once
2017-06-02 14:47:24 +08:00
#include "../acl_cpp_define.hpp"
2014-11-19 00:25:21 +08:00
#ifdef HOOK_NEW
#if defined(_WIN32) || defined(_WIN64)
2014-11-19 00:25:21 +08:00
# ifdef NDEBUG
void* operator new(size_t n);
void operator delete(void *p);
# endif
#else
#include <new>
void* operator new(size_t n) throw (std::bad_alloc);
void operator delete(void *p) throw();
#endif
#endif
namespace acl {
ACL_CPP_API void acl_slice_init(void);
/**
* <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param size {size_t} <EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ijߴ<EFBFBD><EFBFBD><EFBFBD>С
* @param filename {const char*} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param funcname {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param lineno {int} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
* @return {void*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><EFBFBD>abort
2014-11-19 00:25:21 +08:00
*/
ACL_CPP_API void* acl_new(size_t size, const char* filename,
const char* funcname, int lineno);
/**
* <EFBFBD>ͷ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>
* @param ptr {void*} <EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD>ַ
* @param filename {const char*} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param funcname {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @param lineno {int} Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>к<EFBFBD>
2014-11-19 00:25:21 +08:00
*/
ACL_CPP_API void acl_delete(void *ptr, const char* filename,
const char* funcname, int lineno);
}