2 ms·
Yes, the Go garbage collector would need to support some new memory layouts to make certain kinds of unions efficient. A union between a double, a pointer, and
by skybrian 2y ago
Yes, the Go garbage collector would need to support some new memory layouts to make certain kinds of unions efficient. A union between a double, a pointer, and small integer types (as done in languages like JavaScript) might be a good start?
- tignaj 2y agoHere is a fairly efficient version of a simple union like that I did a while back https://github.com/tigrannajaryan/govariant https://github.com/tigrannajaryan/govariant