Poke_Transporter_GB/source
Philippe Symons 32db0d690d Implement custom malloc -> rom space: -3 KB, IWRAM: -1 KB
I found another way to optimize the rom space by implementing a custom malloc, free, realloc and calloc
function.

This reduces rom size by 3 KB and IWRAM usage by 1 KB. (elimination of __malloc_av). The original
implementation is much more complex and larger than it needs to be.

The custom malloc is implemented as a bitmap allocator. It keeps a bitmap to track which pages of the
heap are allocated. Like the original allocator, it uses the free space in EWRAM after the multiboot gba
rom. But unlike the original allocator, we control the size with CUSTOM_MALLOC_POOL_SIZE.

The custom malloc can be disabled with USE_CUSTOM_MALLOC.
2025-06-20 22:39:42 +02:00
..
background_engine.cpp Modifying the remote multiboot loader 2025-04-06 17:09:52 -04:00
box_menu.cpp Merge branch 'optimizations/reduce-binarysize-remove-libstdc++' into optimizations/implement-zx0-compression 2025-05-25 22:45:47 +02:00
button_handler.cpp Updating tons of graphics 2024-08-19 14:47:29 -04:00
button_menu.cpp Reduce binary size by eliminating libstdc++ 2025-04-09 20:04:08 +02:00
custom_malloc.c Implement custom malloc -> rom space: -3 KB, IWRAM: -1 KB 2025-06-20 22:39:42 +02:00
delays.cpp Organizing files 2024-03-19 13:52:23 -05:00
dex_handler.cpp Updating buttons and dialogue 2024-03-29 11:55:54 -05:00
flash_mem.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
gameboy_colour.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
global_frame_controller.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
interrupt.cpp Fixing interrupts 2024-03-20 15:38:33 -05:00
interrupts_gba.c Fixing interrupts 2024-03-20 15:38:33 -05:00
irq_handler.s Fixing interrupts 2024-03-20 15:38:33 -05:00
japanese_small.s Updating Dream Dex 2025-04-06 11:57:37 -04:00
latin_short.s Updating Dream Dex 2025-04-06 11:57:37 -04:00
libstd_replacements.cpp Implement custom malloc -> rom space: -3 KB, IWRAM: -1 KB 2025-06-20 22:39:42 +02:00
linker_optimizations.cpp Optimize the MOVESETS table for compression + eliminate 4 KB "handles" buffer from 2025-04-29 22:22:38 +02:00
main.cpp Implement custom malloc -> rom space: -3 KB, IWRAM: -1 KB 2025-06-20 22:39:42 +02:00
memory.c Restoring memory.c 2024-03-20 15:41:03 -05:00
multiboot_upload.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
mystery_gift_builder.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
mystery_gift_injector.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
payload_builder.cpp Merge remote-tracking branch 'upstream/text-and-box-rewrite' into optimizations/implement-zx0-compression 2025-06-18 21:07:11 +02:00
pkmn_font.s Compress the graphics (mostly), fix potential vram memcpy issue 2025-01-17 19:32:48 -05:00
pokedex.cpp Add compression for the text data, output stack usage .su files and rework script_array 2025-05-21 12:21:06 +02:00
pokemon_data.cpp Merge branch 'master' into optimizations/implement-zx0-compression 2025-05-21 13:16:45 +02:00
pokemon_party.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
pokemon.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
random.cpp Disabling new conversion 2025-05-21 11:43:16 -04:00
rom_data.cpp Merge remote-tracking branch 'upstream/text-and-box-rewrite' into optimizations/reduce-binarysize-remove-libstdc++ 2025-06-18 20:59:18 +02:00
save_data_manager.cpp Updating Dream Dex 2025-04-06 11:57:37 -04:00
save.cpp Organizing files 2024-03-19 13:52:23 -05:00
script_array.cpp Fix ptgb_write_debug() after merge 2025-05-27 22:39:16 +02:00
script_obj.cpp Add compression for the text data, output stack usage .su files and rework script_array 2025-05-21 12:21:06 +02:00
script_var.cpp Add compression for the text data, output stack usage .su files and rework script_array 2025-05-21 12:21:06 +02:00
select_menu.cpp Add compression for the text data, output stack usage .su files and rework script_array 2025-05-21 12:21:06 +02:00
sprite_data.cpp Merge remote-tracking branch 'upstream/text-and-box-rewrite' into optimizations/implement-zx0-compression 2025-06-18 21:07:11 +02:00
text_data_table.cpp Move reading dialogue text out of the text_loop() to conserve IWRAM 2025-05-21 17:39:52 +02:00
text_engine.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
translated_text.cpp Fixing some graphics tearing 2025-04-08 14:28:30 -04:00
z80_asm.cpp Fix crash + unrelated buffer overflow + some optimizations 2025-06-18 10:23:03 +02:00
zx0_decompressor.cpp Add compression for the text data, output stack usage .su files and rework script_array 2025-05-21 12:21:06 +02:00