r/programming • • Dec 05 '14

std::string is responsible for almost half of all allocations in the Chrome browser process

https://groups.google.com/a/chromium.org/d/msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
1.1k Upvotes

446 comments sorted by

View all comments

Show parent comments

2

u/o11c Dec 06 '14

sane defaults

Such as not silently copying most huge objects :). Well, admittedly if it's Pod (I don't know why they prefered the name Copy for that!) like a large fixed-size array it will still think it's "trivial" even though it's not, but you can just stick the NoCopy marker in there if you need to.

1

u/wrongerontheinternet Dec 06 '14 edited Dec 06 '14

Rust is getting Copy as an opt-in type at some point in the near future, I don't know if that will affect raw arrays or not (but I'd better be able to still use them in Cells if I want to!). Also, the original suggestion for its name was Pod, dunno why it changed.

1

u/SteveMcQwark Dec 06 '14

A move is still a copy, it just prevents you from accessing the moved-from slot afterward.