David, I hope you (and Eliot) do not mind me getting in the middle of the discussion, but your patch is interesting and maybe I can help with the review.

I think that the patch is safe to include as it is, but it would be good to understand why it is required for Solaris. After reading the man pages at https://illumos.org/man/2/sbrk and https://illumos.org/man/2/mmap I would guess that the difference might related to either:

  1. sbrk(0) answers a page-aligned address Linux but not on Solaris, or
  2. mmap() has some different requirements for the supplied address (as explained in your notes above).

Your patch finds a different (higher) address for the hint, and also page-aligns it. I am wondering if the page alignment is the main issue, in which case it may be possible to address it by just adding this one line:

   hint = roundUpToPage((usqInt)hint);

This has no net effect on the Linux calculation because the hint address from sbrk() is already page-aligned. And Solaris 11.4 already works, so If if it fixes the problem for Solaris 11.3 then it might be the simplest solution, and no #ifdef needed.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <OpenSmalltalk/opensmalltalk-vm/issues/665/1872428184@github.com>