added array_alloc/array_realloc/array_free functions at TypeFunc.h

This commit is contained in:
2023-03-17 21:01:30 +08:00
parent 41a2f9af72
commit 2f4a583b9c

View File

@@ -468,6 +468,24 @@ namespace hgl
{
memset(data,0,sizeof(T)*count);
}
template<typename T>
inline T *array_alloc(const uint count)
{
return (T *)hgl_malloc(count*sizeof(T));
}
template<typename T>
inline T *array_realloc(T *origin,const uint count)
{
return (T *)hgl_realloc(origin,count*sizeof(T));
}
template<typename T>
inline void array_free(T *items)
{
hgl_free(items);
}
}//namespace hgl
/**