Description: adjust canvas allocate memory

IssueNo: https://gitee.com/openharmony/graphic_utils/issues/I68JMI
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: lancer <haoshuo@huawei.com>
This commit is contained in:
lancer
2023-01-03 16:36:36 +08:00
parent 4de2432a85
commit 25b0d3af72
2 changed files with 3 additions and 3 deletions
@@ -376,7 +376,7 @@ struct GeometryArrayAllocator {
if (num < 1) {
num = 1;
}
return new T[num];
return static_cast<T*>(UIMalloc(num * sizeof(T)));
}
/**
* @brief Array memory free
@@ -385,7 +385,7 @@ struct GeometryArrayAllocator {
*/
static void Deallocate(T* ptr, uint32_t)
{
delete[] ptr;
UIFree(ptr);
}
};
@@ -64,7 +64,7 @@ class RasterizerCellsAntiAlias {
* @version 1.0
*/
enum CellBlockScale {
CELL_BLOCK_SHIFT = 12,
CELL_BLOCK_SHIFT = 5,
CELL_BLOCK_SIZE = 1 << CELL_BLOCK_SHIFT,
CELL_BLOCK_MASK = CELL_BLOCK_SIZE - 1,
CELL_BLOCK_POOL = 256