System/FFI/LibC: Use Round-robin mem_task selection for calloc
This commit is contained in:
parent
15926654f8
commit
d56a092dde
1 changed files with 8 additions and 1 deletions
|
@ -10,11 +10,18 @@ U0 bcmp()
|
|||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
U64 @calloc(I64 size)
|
||||
{
|
||||
U64 res = CAlloc(size, malloc_mem_task[malloc_current_mem_task % MALLOC_MEM_TASK_COUNT]->code_heap);
|
||||
malloc_current_mem_task++;
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 calloc()
|
||||
{
|
||||
PUSH_SYSV_REGS
|
||||
GET_SYSV_ARGS
|
||||
CAlloc(p0 * p1, erythros_mem_task->code_heap);
|
||||
@calloc(p0 * p1);
|
||||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue