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?
-
-
Hmm, not sure how you fit a pointer+size into a word? Or is that on the heap? Can't you race on accessing the heap data too? (sorry if this is obvious, I know nothing about Java/CLR)
-
The only array-like object in Java is an array, which is represented as a pointer to a (length, elements…) structure in memory. You can’t directly take an interior pointer to an element of the array. So you can always dereference the pointer to find the length.
- 3 more replies
New conversation -
-
-
The basic problem is that if memory safety depends on values larger than a word remaining in sync multithreading becomes very tough. (Unless you’re like Rust and can ensure no data races in other ways.)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.