The routine doesn't fail.swensont wrote: Sun Mar 09, 2025 3:23 am If it is a stack limit, you might try testing with a drive with only a few directories and see how that works. Test a minimal case to confirm that it works in that instance. Then expend with more directories until it fails. The issue could also be the depth of the directories. You could test with a drive with, say 4 directories that have only a single depth. Then expand a bit until failure to see how far you can go.
"data space can also run out if routines keep calling one another without RETuning." Maybe set data space to some large amount just to confirm if it still fails (again this is only for testing purposes).
Using Turbo: I set the dataspace to 500k and stack to 9990 (the largest possible value). The routine correctly calculates the size of my entire drive (about 128 Mb of data) and it can be called twice in a row.
Then it crashes.
For win1_Games_ it can be executed 22 times in a row.
It looks like the compiled routine does not clear the used dataspace and/or stack when it ends, and each call eats away the available space.
Using Liberator: With heap size=2048 (default value) and stack=10k, the routine can be called any number of times for any directory, including full drive.
When it is QLiberated it doesn't leak heap, dataspace, stack. It behaves as expected.
From SuperBasic: the routine can be called any number of times for any directory, including full drive.
This looks to me to be a Turbo compiler issue. Maybe I am setting some compile parameters wrong, I have no clue ..