16.01.2013 19:24, Max Kellermann пишет: > Why custom memory management, when std::string already does all we > need? Transfer of ownership is std::move(). But only if internal > path names are already in std::string, which was my suggestion.
Well, you insisted on not-having overhead here. (I don't actually think the explained below process is too much overhead, but): What would map_uri_fs() look like? We are gived UTF-8 URI and need to return std::string-based type. First we call character conversion routine. This allocates some memory. Then we copy the result to our std::string-wrapper (aka Path). This employs additional copying, don't it? Finally we free the our char* buffer and return Path. > But it's even easier; with my idea, you don't need to transfer > ownership at all. Let some code do the talking: Well this is exactly what I've proposed from start of our discussion (starting from "Some bonus thoughts"). And you initially disagreed with it. I'm not native English speaker so I attribute this to my poor explanation skills. -- Denis ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team