Use memset() in CGDCalloc() again

The bug was libfxcg's sys_calloc() using a memsetZero() function which
simply doesn't work properly.
This commit is contained in:
Lephenixnoir 2021-07-17 16:35:31 +02:00
parent 55c2e64000
commit 7a75e46715
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 2 additions and 3 deletions

1
README
View File

@ -21,6 +21,7 @@ The differences are (I might push it later):
* Syscall 0x1B0B, getSecondaryVramAddress() is added in libfxcg/
* abort() is removed from libc/ (CGDOOM has its own)
* calloc() defined in libc/ (just a call to sys_calloc)
* sys_calloc() fixed in libfxcg/ to use memset (memsetZero is broken)
* Linker script outputs in elf32-sh format
* Linker script sets 500k of RAM instead of 64k
* LTO disabled (hopefully it could be reenabled later)

View File

@ -20,9 +20,7 @@ void * CGDCalloc(int iSize)
void *p = CGDMalloc(iSize);
if(p != NULL)
{
/* volatile here prevents GCC from calling memset(), which
doesn't seem to work for some obscure reason... */
for(int i = 0; i < iSize; i++) ((volatile char *)p)[i] = 0;
memset(p,0,iSize);
}
return p;
}