mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-05-11 03:12:15 +00:00
Use calloc instead of malloc for initializing the overlays
This commit is contained in:
parent
6a68f41f8d
commit
cfec700f10
2 changed files with 3 additions and 3 deletions
|
|
@ -143,7 +143,7 @@ extern "C" void unload_overlays(int32_t ram_addr, uint32_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_overlays() {
|
void init_overlays() {
|
||||||
section_addresses = (int32_t *)malloc(sections_info.total_num_sections * sizeof(int32_t));
|
section_addresses = (int32_t *)calloc(sections_info.total_num_sections, sizeof(int32_t));
|
||||||
|
|
||||||
for (size_t section_index = 0; section_index < sections_info.num_code_sections; section_index++) {
|
for (size_t section_index = 0; section_index < sections_info.num_code_sections; section_index++) {
|
||||||
section_addresses[sections_info.code_sections[section_index].index] = sections_info.code_sections[section_index].ram_addr;
|
section_addresses[sections_info.code_sections[section_index].index] = sections_info.code_sections[section_index].ram_addr;
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ void set_callbacks(const rsp::callbacks_t& rsp_callbacks, const audio_callbacks_
|
||||||
|
|
||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||||
|
|
||||||
// #define debug_printf(...)
|
#define debug_printf(...)
|
||||||
#define debug_printf(...) printf(__VA_ARGS__);
|
//#define debug_printf(...) printf(__VA_ARGS__);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue