3 ms·
The obvious approach to that issue is to support garbage-collected objects as a special address space within the program. You could use normal read-only pointe
by zozbot234 4y ago
The obvious approach to that issue is to support garbage-collected objects as a special address space within the program. You could use normal read-only pointers to address these, but write pointers to them would be specialized and incur that memory barrier overhead.
- WalterBright 4y agoThere's an API call into the GC that does just that, tell you if it points into the GC pool or not. Unfortunately, it's not fast enough.
- zozbot234 4y agoWhy does this have to be a runtime check? Perhaps the compiler could optimize pointer writes that can be proven not to affect garbage-collected objects, by dispensing with the memory barrier overhead for those.