Double bounds check could be implemented with cmp/cmovle/cmp to avoid an extra branch, though it will be extremely well predicted anyway.
-
-
Show 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.
Show this thread
End of conversation
New conversation -
-
-
Do you know how C# and Java do it?
-
Don't they just have locks on everything?
- 6 more replies
New conversation -
-
-
What does (3) have to do with making Go memory safe. I don't doubt maps aren't memory safe; I'm curious about why "implement with no unsafe" helps. Aren't Go maps just fat pointers like interfaces and slices?
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.