SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
宏定义 | 函数
memory.cpp 文件参考

浏览源代码.

宏定义

#define SG_SPECIALIZED_MALLOC(type)
 

函数

void * operator new (size_t size) throw (std::bad_alloc)
 
void operator delete (void *p) throw ()
 
void * operator new[] (size_t size) throw (std::bad_alloc)
 
void operator delete[] (void *p) throw ()
 
void * sg_malloc (size_t size)
 
void * sg_calloc (size_t num, size_t size)
 
void sg_free (void *ptr)
 
void * sg_realloc (void *ptr, size_t size)
 

宏定义说明

#define SG_SPECIALIZED_MALLOC (   type)
值:
template<> type* sg_generic_malloc<type >(size_t len) \
{ \
return new type[len](); \
} \
\
template<> type* sg_generic_calloc<type >(size_t len) \
{ \
return new type[len](); \
} \
\
template<> type* sg_generic_realloc<type >(type* ptr, size_t old_len, size_t len) \
{ \
type* new_ptr = new type[len](); \
size_t min_len=old_len; \
if (len<min_len) \
min_len=len; \
for (size_t i=0; i<min_len; i++) \
new_ptr[i]=ptr[i]; \
delete[] ptr; \
return new_ptr; \
} \
\
template<> void sg_generic_free<type >(type* ptr) \
{ \
delete[] ptr; \
}

在文件 memory.cpp368 行定义.

函数说明

void operator delete ( void *  p)
throw (
)

在文件 memory.cpp126 行定义.

void operator delete[] ( void *  p)
throw (
)

在文件 memory.cpp176 行定义.

void* operator new ( size_t  size)
throw (std::bad_alloc
)

在文件 memory.cpp96 行定义.

void* operator new[] ( size_t  size)
throw (std::bad_alloc
)

在文件 memory.cpp145 行定义.


SHOGUN 机器学习工具包 - 项目文档