GC issue? List.pool overwritten by allocated object
Ali Çehreli
acehreli at yahoo.com
Wed May 14 04:26:08 UTC 2025
On 5/12/25 8:31 AM, Denis Feklushkin wrote:
> Vulkan API is used and it implicitly creates threads.
Do those threads call back to D code that allocate from the GC? If so,
the GC must be aware of the threads to be able to suspend them during a
collection.
I had to call thread_attachThis() to do that in a past project:
https://dlang.org/library/core/thread/osthread/thread_attach_this.html
However, it was not clear whether or when to make a corresponding call
to thread_detachThis(). If Vulkan threads disappear on their own, your
only chance for a call to thread_detachThis() may be right before
returning from your D callback function.
Ali
More information about the Digitalmars-d
mailing list