Hello, perhaps another possible improvement to the use of sbrk() is that the return value could be inspected for -1 (errno). Like in

hint = sbrk(0à; if (hint == -1) quitvm(errno);

this could theoretically happen in a few cases that the return value of sbrk() is not a pointer or address at all.

However what I observe on Solaris is that sbrk() returns an address but it is not aligned as expected in the loop in OpenSmalltalk that uses that address.

So my pull request is just as simple modification that addresses that issue, not the general issue of whether sbrk() should be used at all or if it can be assumed to return -1 as an error.

The code need not be perfect anyway because the situations where sbrk() will return -1 are already obscure , related to for example maximum sizes imposed to the process.

The immediate motivation in my case is just to have a working VM on the Solaris operating system because obviously if the initiial allocation failed due to address not correctly aligned, then the VM does not start at all ...


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/1930400144@github.com>