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:
parent
55c2e64000
commit
7a75e46715
1
README
1
README
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue