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?
-
-
Arrays can never change size in Java. But there’s a library type called ArrayList that implements growable arrays on top of the basic primitive, by reallocating the underlying backing store as necessary.
-
So there’s no way for the length to become out of sync unless the array storage itself were to be deallocated and reallocated, but that can only happen during the sweep phase of GC, which guarantees no more pointers to the array by construction and therefore no races.
- 1 more reply
New conversation -
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.