-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method for finding cold end of stack needs justification #210
Comments
We now have proof that the statement from the manual is false. A cold-end marker obtained this way does not necessarily include roots in the same stack frame. So the statement that the program's active local variables are placed after the marker is false. To get a reliable placement warmer than the marker you need to be in a child stack frame. JPH proved this while editing the arena extension/contraction test. |
This avoids the issue #210 Also increase the number of test objects by *10 to make it more likely the arena will decide to contract. Also comment out some printfs in the interrupt context, to avoid messy output. Also fix some typos in comments
627ded3 contains a further workaround that was necessary on clang 14. |
addrobj.c has also been written in #223 subsequent to the creation of this issue in a way which avoids the issue (i.e. registering a static region of memory to hold ambiguous pointers rather than register the stack and store them there.) It's not known whether the issue would exist in addrobj.c had it been written in a way which used stack roots. |
The manual advises the use of a stack marker to find the cold end of the stack:
mps/manual/source/guide/lang.rst
Lines 984 to 995 in 179341b
Is this advice reliable with current compiler optimisations on our target platforms?
We should check and record our justification for it. We should also test for it, for example, by asserting about it in our tests, so that we are warned if it ever becomes false.
Incidentally, on this topic, design.mps.stack-scan.req.stack.cold.not says:
mps/design/stack-scan.txt
Lines 48 to 50 in 179341b
The text was updated successfully, but these errors were encountered: