Like realloc but sets new memory to 0.
| 551 | |
| 552 | // Like realloc but sets new memory to 0. |
| 553 | void* ILAPIENTRY ilRecalloc(void *Ptr, ILuint OldSize, ILuint NewSize) |
| 554 | { |
| 555 | void *Temp = ialloc(NewSize); |
| 556 | ILuint CopySize = (OldSize < NewSize) ? OldSize : NewSize; |
| 557 | |
| 558 | if (Temp != NULL) { |
| 559 | if (Ptr != NULL) { |
| 560 | memcpy(Temp, Ptr, CopySize); |
| 561 | ifree(Ptr); |
| 562 | } |
| 563 | |
| 564 | Ptr = Temp; |
| 565 | |
| 566 | if (OldSize < NewSize) |
| 567 | imemclear((ILubyte*)Temp + OldSize, NewSize - OldSize); |
| 568 | } |
| 569 | |
| 570 | return Temp; |
| 571 | } |
| 572 | |
| 573 | |
| 574 | // To keep Visual Studio happy with its unhappiness with ILAPIENTRY for atexit |
nothing calls this directly
no outgoing calls
no test coverage detected