[LLVMdev] std::string

Reed Kotler rkotler at mips.com
Sat Jan 19 20:41:35 PST 2013


On 01/19/2013 06:36 PM, Chris Lattner wrote:
> On Jan 19, 2013, at 6:00 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote:
>> On 1/19/2013 7:55 PM, Sean Silva wrote:
>>>
>>> Although SmallString is actually pretty inefficient, since it keeps
>>> the string data separate from the "vector" header. I believe libc++'s
>>> std::string actually reuses the pointers in the "vector header" as the
>>> storage for the "small" size, and so in that case std::string is
>>> effectively a very memory efficient SmallString with storage of
>>> roughly 3 pointers' worth of chars.
>>
>> Why do we actually have all the local versions of containers that already exist as a part of the C++ standard (such as SmallVector, DenseMap, et al.)?
>
> See:
> http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure-for-a-task
>
> -Chris
>
Embarrassed to admit I have not read that manual yet have done a full 
port. :)

Just did things from seeing how other people did them.

Never too late to learn though. Time to peruse through the main docs 
page again and of course to read the Programmers Manual!

Reed




More information about the llvm-dev mailing list