News for hackers. Stuff that matters.

dreiss

Re:Folly - The Faceboook open source library on Sunday June 03, 2012 @12:00PM (#4061076)
- It adjusts its growth strategy to work well with the properties of the allocator.

- It requires that its members be relocatable and uses memmove to speed up move operations.

Re:Folly - The Faceboook open source library on Sunday June 03, 2012 @11:56AM (#4061070)
If your object is in a vector, it's already possible for the vector to move the object without updating any pointers to it. The only question is whether it is safe for the vector to move the object with memmove instead of invoking a copy/move constructor, essentially skipping the step of telling the object that it is being moved. This will only fail if the object contains pointers to its own sub-objects (or the move constructor updates external pointers). This is fairly rare, especially for objects that you would store directly in a vector.

std::string is a key exception to this, but fbstring is not.