Skip to content

Conversation

@xavierleroy
Copy link
Contributor

Now that stack allocation is entirely under the control of the OCaml runtime system, it's time to use more generous stack limits than those provided by operating systems.

This commit sets the default maximum stack size to 128 Miwords, i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.

See #10736 and #10954 for context.

@xavierleroy xavierleroy added this to the 5.0.0 milestone May 4, 2022
@shindere
Copy link
Contributor

shindere commented May 10, 2022 via email

@xavierleroy
Copy link
Contributor Author

How about documenting in which unit the stack size is expressed? I assume it's in words

The unit is indeed words, and it's documented in the reference manual where the OCAMLRUNPARAM variable is documented, as well as in the runtime/caml/config.h source file. What extra documentation is needed?

Also, I'm sorry, I didn't understand what you did in the test. You sem
to specify a constant size, still you say that it's to make the test
robust to increases of the stack size. Would you mind clarifying?

The test wants to trigger a stack overflow. After increasing the default max stack size, it would no longer trigger it. Hence the test must be run with a fixed max stack size that is known to trigger the stack overflow.

@shindere
Copy link
Contributor

shindere commented May 10, 2022 via email

@shindere
Copy link
Contributor

@xavierleroy don't you want to add a Changes entry?

To please check-typo but also because that may be interesting to users.

Now that stack allocation is entirely under the control of the OCaml
runtime system, it's time to use more generous stack limits than
those provided by operating systems.

This commit sets the default maximum stack size to 128 Miwords,
i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.
So that the test is robust against bumping the default max stack size.
@xavierleroy
Copy link
Contributor Author

Changes entry added, now merging !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants