Closed sethrj closed 2 months ago
Sorry, just noticed I didn't hit "send" on this comment yesterday...
@esseivaju I think it's much too dangerous to keep long-term string views. Even this is going to lead to an invalid read:
my_string_vec.emplace_back(label);
my_string_view_map.insert({my_string_vec.back(), value});
because once the vector changes capacity, the string views in the map are invalidated.
I think string views are meant primarily for interfaces and not for long-term storage.
This prevents repeated allocation/deallocation during the stepping loop as noticed by @esseivaju in #1172.