@@ -26,11 +26,11 @@ static struct of_huffman_tree * newTree(void) { struct of_huffman_tree *tree; - tree = of_alloc(1, sizeof(*tree)); + tree = OFAllocMemory(1, sizeof(*tree)); tree->leaves[0] = tree->leaves[1] = NULL; tree->value = 0xFFFF; return tree; } @@ -65,13 +65,13 @@ @try { for (uint16_t i = 0; i < count; i++) { uint_fast8_t length = lengths[i]; if OF_UNLIKELY (length > maxBit) { - lengthCount = of_realloc(lengthCount, + lengthCount = OFResizeMemory(lengthCount, length + 1, sizeof(uint16_t)); - nextCode = of_realloc(nextCode, + nextCode = OFResizeMemory(nextCode, length + 1, sizeof(uint16_t)); for (uint_fast8_t j = maxBit + 1; j <= length; j++) { lengthCount[j] = 0; @@ -100,12 +100,12 @@ if (length > 0) insertTree(tree, nextCode[length]++, length, i); } } @finally { - free(lengthCount); - free(nextCode); + OFFreeMemory(lengthCount); + OFFreeMemory(nextCode); } return tree; } @@ -124,7 +124,7 @@ { for (uint_fast8_t i = 0; i < 2; i++) if OF_LIKELY (tree->leaves[i] != NULL) of_huffman_tree_release(tree->leaves[i]); - free(tree); + OFFreeMemory(tree); }