Either I'm confused or the gc is
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon Nov 16 21:54:31 UTC 2020
On Monday, 16 November 2020 at 21:25:03 UTC, Steven Schveighoffer
wrote:
> I can imagine a situation where it removes the item from the
> stack to put it somewhere else (e.g. global memory or on the C
> heap) *temporarily*, and by the time the function exits, the
> pointer is no longer in use in C-land. Thus, the function
> doesn't "save the pointer".
>
> This kind of problem would still be susceptible to the GC
> collecting it (via another thread), and so I would recommend
> still storing locally in the calling function a copy of the
> pointer.
How do you express that? LLVM can remove unused pointers? There
are intrinsics to combat that, but is there something portable in
D?
More information about the Digitalmars-d
mailing list