3 Commits
Author SHA1 Message Date
Thomas MartinandClaude Opus 5.5 a3d27ce9d5 Native IOP threads: a deleted thread's stack is taken again
CreateThread took each task's stack from a bump arena (0x1fe000 down to 0x190000) and DeleteThread never gave it
back, so a game that creates and deletes IOP threads at every map load ran the arena out: Steambot Chronicles stopped
with "native library task stacks exhausted" (thbase 4) after about 20 map loads.

- DeleteThread puts the task's stack on a free list; CreateThread takes the smallest free stack that fits (its whole
  size becomes the task's) before the arena's next.
- The free list is saved in the IOP section's new "taskstacks" part; a state saved before it loads with none free.
- Test: 257 CreateThread / DeleteThread pairs with 4 KiB stacks, each thread on the first one's stack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 14:38:39 +01:00
Thomas Martin 56df451cef Allow native timer callbacks to cancel due timers safely 2026-11-06 09:37:30 +01:00
Thomas Martin 11cb6df323 Add reusable native image, compiled-library and port services 2026-11-06 02:47:13 +01:00