Per thread heap, GC, etc.

IGotD- nise at nise.com
Fri May 14 17:13:00 UTC 2021


On Friday, 14 May 2021 at 17:02:00 UTC, Markk wrote:
>
> I disagree by 180°. If the memory management is associated with 
> the thread, such "foreign" threads would be completely left 
> alone by D or the GC, and that's exactly as it should be. 
> Passing memory from/to that thread to a D thread is already a 
> difficult thing to do right, this proposal would make that 
> safer and more formal.
>

If for example C++ calls a D function, the D function does 
something temporary with arrays then those arrays will not be 
cleaned up if the array memory is thread local.

More likely since the thread has no meta data in D, some error 
will happen. The programmer will sure know it but this is very 
inconvenient as the D function will not work if called outside D.


More information about the Digitalmars-d mailing list