现在allocator已经不是这样的设计了,而是使用全局new出来的内存,因为malloc实际上现在也是内存池化的设计。
现在allocator已经不是这样的设计了,而是使用全局new出来的内存,因为malloc实际上现在也是内存池化的设计。
Malloc 函数功能在用户内存池中根据指定size大小申请device内存。 函数原型virtual MemBlock *Malloc(size_t size) = 0; 参数说明 参数名 ……欲了解更多信息欢迎访问华为HarmonyOS开发者官网
it's often more convenient to have something a bit simpler thanstd::allocator. We can usemallocinstead of::operator new, and we can leave out the complicated performance optimizations that you'll find