mirror of
https://git.checksum.fail/alec/erythros
synced 2025-12-12 05:59:53 +02:00
System/FFI/LibC: Use Round-robin mem_task selection for calloc
This commit is contained in:
@@ -10,11 +10,18 @@ U0 bcmp()
|
|||||||
POP_SYSV_REGS
|
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()
|
U0 calloc()
|
||||||
{
|
{
|
||||||
PUSH_SYSV_REGS
|
PUSH_SYSV_REGS
|
||||||
GET_SYSV_ARGS
|
GET_SYSV_ARGS
|
||||||
CAlloc(p0 * p1, erythros_mem_task->code_heap);
|
@calloc(p0 * p1);
|
||||||
POP_SYSV_REGS
|
POP_SYSV_REGS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user