Discussion in 'Homebrew Development' started by White Dragon, Sep 1, 2018.
Hi to all.
I don't understand a memory violation on PS3 port when realloc a memory.
This happens only with a mod: Knights of the Round Revenge and just on PS3 (on PC it's ok).
I use Windows and debuggin it on win version I have no exceptions.
Here the code:
void alloc_specials(s_model *newchar)
newchar->special = realloc(newchar->special, sizeof(*newchar->special) * (newchar->specials_loaded + 1)); // <------------ MEM VIOLATION
memset(newchar->special + newchar->specials_loaded, 0, sizeof(*newchar->special));
it fails that realloc.
The strange thing is that the "special" member of newchar (s_model) has fixed memory allocated.
So... What's wrong? Thanks..
Separate names with a comma.