News for hackers. Stuff that matters.
Re:Rust: Dropping heavy things in another thread can make yo... by pjmlp on Monday June 01, 2020 @03:23AM (#23376073)
Not necessary, std::map::map(&&) is free to move just the internal pointers and bookkeeping data, only dumb implementations would move the memory blocks where the map data is actually stored, as per ISO C++ requirements.
Re:Rust: Dropping heavy things in another thread can make yo... by ahupp on Monday June 01, 2020 @02:01PM (#23381603)
The comment originally said it was the cost of a pointer copy, and I was pointing out it's not a pointer. eg., sizeof(std::map<std::string,std::string>) is 48, which is the "pointers and bookeeping" you mention.
Re:Rust: Dropping heavy things in another thread can make yo... by pjmlp on Tuesday June 02, 2020 @12:52AM (#23387593)
Ah sorry for the misinterpretation. Should have payed more attention.