mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
mem: Remove memalign
It doesn't do what it should anyway.
This commit is contained in:
parent
9533dea124
commit
f3d071ca69
6 changed files with 6 additions and 18 deletions
|
@ -132,7 +132,7 @@ uintptr_t ianos_loader(bool sdmount, char *path, elfType_t type, void *moduleCon
|
||||||
sd_unmount();
|
sd_unmount();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
elfBuf = memalign(ctx.align, ctx.memsz);
|
elfBuf = malloc(ctx.memsz); // Aligned to 0x10 by default.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!elfBuf)
|
if (!elfBuf)
|
||||||
|
|
|
@ -107,17 +107,12 @@ void heap_init(u32 base)
|
||||||
|
|
||||||
void *malloc(u32 size)
|
void *malloc(u32 size)
|
||||||
{
|
{
|
||||||
return (void *)_heap_alloc(&_heap, size, 0x10);
|
return (void *)_heap_alloc(&_heap, size, sizeof(hnode_t));
|
||||||
}
|
|
||||||
|
|
||||||
void *memalign(u32 align, u32 size)
|
|
||||||
{
|
|
||||||
return (void *)_heap_alloc(&_heap, size, align);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *calloc(u32 num, u32 size)
|
void *calloc(u32 num, u32 size)
|
||||||
{
|
{
|
||||||
void *res = (void *)_heap_alloc(&_heap, num * size, 0x10);
|
void *res = (void *)_heap_alloc(&_heap, num * size, sizeof(hnode_t));
|
||||||
memset(res, 0, num * size);
|
memset(res, 0, num * size);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,5 @@ void heap_init(u32 base);
|
||||||
void *malloc(u32 size);
|
void *malloc(u32 size);
|
||||||
void *calloc(u32 num, u32 size);
|
void *calloc(u32 num, u32 size);
|
||||||
void free(void *buf);
|
void free(void *buf);
|
||||||
void *memalign(u32 align, u32 size);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -100,7 +100,7 @@ uintptr_t ianos_loader(bool sdmount, char *path, elfType_t type, void *moduleCon
|
||||||
sd_unmount(true);
|
sd_unmount(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
elfBuf = memalign(ctx.align, ctx.memsz);
|
elfBuf = malloc(ctx.memsz); // Aligned to 0x10 by default.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!elfBuf)
|
if (!elfBuf)
|
||||||
|
|
|
@ -107,17 +107,12 @@ void heap_init(u32 base)
|
||||||
|
|
||||||
void *malloc(u32 size)
|
void *malloc(u32 size)
|
||||||
{
|
{
|
||||||
return (void *)_heap_alloc(&_heap, size, 0x10);
|
return (void *)_heap_alloc(&_heap, size, sizeof(hnode_t));
|
||||||
}
|
|
||||||
|
|
||||||
void *memalign(u32 align, u32 size)
|
|
||||||
{
|
|
||||||
return (void *)_heap_alloc(&_heap, size, align);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *calloc(u32 num, u32 size)
|
void *calloc(u32 num, u32 size)
|
||||||
{
|
{
|
||||||
void *res = (void *)_heap_alloc(&_heap, num * size, 0x10);
|
void *res = (void *)_heap_alloc(&_heap, num * size, sizeof(hnode_t));
|
||||||
memset(res, 0, num * size);
|
memset(res, 0, num * size);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,5 @@ void heap_init(u32 base);
|
||||||
void *malloc(u32 size);
|
void *malloc(u32 size);
|
||||||
void *calloc(u32 num, u32 size);
|
void *calloc(u32 num, u32 size);
|
||||||
void free(void *buf);
|
void free(void *buf);
|
||||||
void *memalign(u32 align, u32 size);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue