The Future of D Runtime
Derek Fawcus
dfawcus+dlang at employees.org
Thu Oct 17 19:49:19 UTC 2024
On Tuesday, 11 June 2024 at 11:38:40 UTC, Dmitry Olshansky wrote:
> On Tuesday, 11 June 2024 at 09:25:15 UTC, Adam Wilson wrote:
>> On Monday, 10 June 2024 at 09:36:14 UTC, Dmitry Olshansky
>> wrote:
>> No other language suffers this problem, not even Go. The
>> reason is that all languages that successfully use Fibers, use
>> dynamically expanding stacks, but this means using a precise
>> stack-scanning moving GC.
>
> Far as I can tell Go dropped segmented stacks I cannot tell if
> they copy the stack around.
FWIW:
(a reply to an old thread, but I did not see this noted in the
thread)
While Go has a precise GC, the GC does not move any items once
they're in the heap.
As to stack growth, once the segmented stacks were dropped, it
switched to a scheme of doubling the size of stacks. So a new
stack is allocated, the contents of the old stack copied to it,
and any pointers in to the stack (which can only be from
elsewhere in the stack) are fixed up. That depends upon the same
precise info which the GC uses.
So the stack does move when it grows, and be fixed up. However
that is not done by the GC.
The stack can point in to the heap, the heap can not point in to
the stack.
DF
More information about the Digitalmars-d
mailing list