fixed print_formatted() to use hcl_outfmtobj() instead of hcl_print().

added 2 new optional callbacks - vmprim.alloc_heap and vmprim.free_heap
This commit is contained in:
2018-03-01 14:47:12 +00:00
parent 0b460a3f2a
commit 9094157e28
6 changed files with 277 additions and 201 deletions

View File

@ -30,7 +30,7 @@ hcl_heap_t* hcl_makeheap (hcl_t* hcl, hcl_oow_t size)
{
hcl_heap_t* heap;
heap = (hcl_heap_t*)HCL_MMGR_ALLOC(hcl->mmgr, HCL_SIZEOF(*heap) + size);
heap = (hcl_heap_t*)hcl->vmprim.alloc_heap(hcl, HCL_SIZEOF(*heap) + size);
if (!heap)
{
hcl_seterrnum (hcl, HCL_ESYSMEM);
@ -58,7 +58,7 @@ hcl_heap_t* hcl_makeheap (hcl_t* hcl, hcl_oow_t size)
void hcl_killheap (hcl_t* hcl, hcl_heap_t* heap)
{
HCL_MMGR_FREE (hcl->mmgr, heap);
hcl->vmprim.free_heap (hcl, heap);
}
void* hcl_allocheapmem (hcl_t* hcl, hcl_heap_t* heap, hcl_oow_t size)