[LLVMdev] std::string

Jeffrey Yasskin jyasskin at googlers.com
Sun Jan 20 22:38:57 PST 2013


On Sun, Jan 20, 2013 at 7:46 AM, Krzysztof Parzyszek
<kparzysz at codeaurora.org> wrote:
> On 1/19/2013 10:00 PM, Chris Lattner wrote:
>>
>> On Jan 19, 2013, at 7:04 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org>
>> wrote:
>>>
>>>
>>> Were the "small n" characteristics the main motivation?
>>
>>
>> It is one of the motivations.
>
>
> What were the others?
>
> The reason I ask is that STL comes all ready, with containers and
> algorithms.  They may not be optimal for every task, but they do their job
> and they are part of the standard.  There may be some price to pay in terms
> of performance/memory usage/etc. for a specific application, but overall it
> may be worth it.  Evidently, in case of LLVM, someone (you?) decided that
> having local set of containers is a better idea.  I simply want to
> understand the reasons behind this decision.
>
> I quickly looked over the library section on containers in the C++03
> standard and I didn't see any paragraphs regarding the allocation strategy
> for classes like "set" or "map".  The LLVM page seems to contain information
> that was based on some specific implementation (or several implementations),
> but was not mandated by the standard itself.

+1 to Chris's answers, and this is somewhat off topic for this list,
but to answer this paragraph: C++03 and C++11 don't explicitly specify
the allocation strategy for set or map (or unordered_map), but they do
specify when iterators and pointers can be invalidated, which only
allows one or a few allocation strategies.

Jeffrey



More information about the llvm-dev mailing list