mirror of
https://git.checksum.fail/alec/slon.git
synced 2025-12-08 12:09:55 +02:00
Everywhere: Use slon_mem_task for memory allocation
This commit is contained in:
@@ -244,7 +244,7 @@ U0 process_elf_rela_plt_entries(Elf* elf)
|
||||
for (i = 0; i < elf->rela_plt_size; i++) {
|
||||
symbol_exists = FALSE;
|
||||
entry_name = elf->dynstr + elf->dynsym[(rela_plt->r_info >> 32)].st_name;
|
||||
handler = MAlloc(sizeof(unimplemented_symbol), adam_task->code_heap);
|
||||
handler = MAlloc(sizeof(unimplemented_symbol), slon_mem_task->code_heap);
|
||||
MemCpy(handler, &unimplemented_symbol, sizeof(unimplemented_symbol));
|
||||
patch = handler + 0x0A;
|
||||
*patch = entry_name;
|
||||
|
||||
@@ -14,7 +14,7 @@ U0 calloc()
|
||||
{
|
||||
PUSH_SYSV_REGS
|
||||
GET_SYSV_ARGS
|
||||
CAlloc(p0 * p1, adam_task->code_heap);
|
||||
CAlloc(p0 * p1, slon_mem_task->code_heap);
|
||||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ I64 @fwrite(U8* ptr, I64 size, I64 nmemb, U64 stream)
|
||||
switch (stream) {
|
||||
case stdout:
|
||||
case stderr:
|
||||
tmp = CAlloc((size * nmemb) + 1, adam_task->code_heap);
|
||||
tmp = CAlloc((size * nmemb) + 1, slon_mem_task->code_heap);
|
||||
MemCpy(tmp, ptr, (size * nmemb));
|
||||
#ifdef QEMU_RUN_TESTS
|
||||
QemuDebugMsg(tmp);
|
||||
@@ -122,7 +122,7 @@ U0 malloc()
|
||||
{
|
||||
PUSH_SYSV_REGS
|
||||
GET_SYSV_ARGS
|
||||
MAlloc(p0, adam_task->code_heap);
|
||||
MAlloc(p0, slon_mem_task->code_heap);
|
||||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
@@ -207,9 +207,9 @@ U8* @realloc(U8* ptr, I64 size)
|
||||
{
|
||||
U8* new;
|
||||
if (!ptr) {
|
||||
new = MAlloc(size, adam_task->code_heap);
|
||||
new = MAlloc(size, slon_mem_task->code_heap);
|
||||
} else {
|
||||
new = MAlloc(size, adam_task->code_heap);
|
||||
new = MAlloc(size, slon_mem_task->code_heap);
|
||||
MemCpy(new, ptr, size);
|
||||
Free(ptr);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ U0 _Znwm()
|
||||
// operator new(unsigned long)
|
||||
PUSH_SYSV_REGS
|
||||
GET_SYSV_ARGS
|
||||
MAlloc(p0, adam_task);
|
||||
MAlloc(p0, slon_mem_task);
|
||||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ U0 _ZnwmRKSt9nothrow_t()
|
||||
// operator new(unsigned long, std::nothrow_t const&)
|
||||
PUSH_SYSV_REGS
|
||||
GET_SYSV_ARGS
|
||||
MAlloc(p0, adam_task);
|
||||
MAlloc(p0, slon_mem_task);
|
||||
POP_SYSV_REGS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user