mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-26 06:49:33 +00:00
libretro/malloc.c: "implement" memalign. Just hope that NewPtr aligns enough anyway (16 byte on PowerPC)
This commit is contained in:
parent
9edd199c83
commit
3eff6ff36f
@ -115,3 +115,22 @@ void *calloc(size_t sz1, size_t sz2)
|
||||
{
|
||||
return _calloc_r(_REENT, sz1, sz2);
|
||||
}
|
||||
|
||||
void *memalign(size_t alignment, size_t sz)
|
||||
{
|
||||
Ptr p = NewPtr(sz);
|
||||
|
||||
if(!p)
|
||||
errno = ENOMEM;
|
||||
|
||||
// FIXME:
|
||||
// NewPtr aligns to 4 bytes on 68020 and 68030,
|
||||
// and to 16 bytes on 68040 and PowerPC.
|
||||
|
||||
// Do something else when more alignment is required.
|
||||
// This might be hard, as adding extra overhead to all normal allocations
|
||||
// just so that we can distinguish things in free() doesn't sound like it's worth it.
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user