Thinking about how to make Go memory safe without using atomics everywhere: 1. Double bounds check slice indexing: i.e. store length of backing store on heap and check it. 2. Box interface types on heap. 3. Implement maps in Go with no unsafe. I think this works?
-
Show this thread
-
Double bounds check could be implemented with cmp/cmovle/cmp to avoid an extra branch, though it will be extremely well predicted anyway.
2 replies 0 retweets 2 likesShow this thread
Alternate solution would be to make slices immutable and heap allocate them (i.e. if you set length, reallocate). This would probably want a generational GC of course to mitigate increased allocation pressure.
12:54 PM - 14 Aug 2019
0 replies
0 retweets
4 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.