1. <legend id='SoWQZ'><style id='SoWQZ'><dir id='SoWQZ'><q id='SoWQZ'></q></dir></style></legend>
      <bdo id='SoWQZ'></bdo><ul id='SoWQZ'></ul>
  2. <tfoot id='SoWQZ'></tfoot>

    <small id='SoWQZ'></small><noframes id='SoWQZ'>

      <i id='SoWQZ'><tr id='SoWQZ'><dt id='SoWQZ'><q id='SoWQZ'><span id='SoWQZ'><b id='SoWQZ'><form id='SoWQZ'><ins id='SoWQZ'></ins><ul id='SoWQZ'></ul><sub id='SoWQZ'></sub></form><legend id='SoWQZ'></legend><bdo id='SoWQZ'><pre id='SoWQZ'><center id='SoWQZ'></center></pre></bdo></b><th id='SoWQZ'></th></span></q></dt></tr></i><div id='SoWQZ'><tfoot id='SoWQZ'></tfoot><dl id='SoWQZ'><fieldset id='SoWQZ'></fieldset></dl></div>

    1. 自定义 C++ 分配器的引人入胜的例子?

      Compelling examples of custom C++ allocators?(自定义 C++ 分配器的引人入胜的例子?)

        <small id='QkywB'></small><noframes id='QkywB'>

        1. <tfoot id='QkywB'></tfoot>
              <legend id='QkywB'><style id='QkywB'><dir id='QkywB'><q id='QkywB'></q></dir></style></legend>
                <bdo id='QkywB'></bdo><ul id='QkywB'></ul>
                  <tbody id='QkywB'></tbody>
                <i id='QkywB'><tr id='QkywB'><dt id='QkywB'><q id='QkywB'><span id='QkywB'><b id='QkywB'><form id='QkywB'><ins id='QkywB'></ins><ul id='QkywB'></ul><sub id='QkywB'></sub></form><legend id='QkywB'></legend><bdo id='QkywB'><pre id='QkywB'><center id='QkywB'></center></pre></bdo></b><th id='QkywB'></th></span></q></dt></tr></i><div id='QkywB'><tfoot id='QkywB'></tfoot><dl id='QkywB'><fieldset id='QkywB'></fieldset></dl></div>
                本文介绍了自定义 C++ 分配器的引人入胜的例子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                放弃 std::allocator 而支持自定义解决方案的真正好理由是什么?您是否遇到过对正确性、性能、可扩展性等绝对必要的情况?有什么非常聪明的例子吗?

                What are some really good reasons to ditch std::allocator in favor of a custom solution? Have you run across any situations where it was absolutely necessary for correctness, performance, scalability, etc? Any really clever examples?

                自定义分配器一直是我不太需要的标准库功能.我只是想知道 SO 上是否有人可以提供一些令人信服的例子来证明它们的存在是合理的.

                Custom allocators have always been a feature of the Standard Library that I haven't had much need for. I was just wondering if anyone here on SO could provide some compelling examples to justify their existence.

                推荐答案

                正如我所提到的 在这里,我已经看到英特尔 TBB 的自定义 STL 分配器通过更改单个

                As I mention here, I've seen Intel TBB's custom STL allocator significantly improve performance of a multithreaded app simply by changing a single

                std::vector<T>
                

                std::vector<T,tbb::scalable_allocator<T> >
                

                (这是切换分配器以使用 TBB 漂亮的线程私有堆的一种快速方便的方法;参见 本文档第 7 页)

                (this is a quick and convenient way of switching the allocator to use TBB's nifty thread-private heaps; see page 7 in this document)

                这篇关于自定义 C++ 分配器的引人入胜的例子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                STL BigInt class implementation(STL BigInt 类实现)
                Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)
              • <tfoot id='QPWlt'></tfoot>
                <i id='QPWlt'><tr id='QPWlt'><dt id='QPWlt'><q id='QPWlt'><span id='QPWlt'><b id='QPWlt'><form id='QPWlt'><ins id='QPWlt'></ins><ul id='QPWlt'></ul><sub id='QPWlt'></sub></form><legend id='QPWlt'></legend><bdo id='QPWlt'><pre id='QPWlt'><center id='QPWlt'></center></pre></bdo></b><th id='QPWlt'></th></span></q></dt></tr></i><div id='QPWlt'><tfoot id='QPWlt'></tfoot><dl id='QPWlt'><fieldset id='QPWlt'></fieldset></dl></div>
                  <tbody id='QPWlt'></tbody>

                  <small id='QPWlt'></small><noframes id='QPWlt'>

                  <legend id='QPWlt'><style id='QPWlt'><dir id='QPWlt'><q id='QPWlt'></q></dir></style></legend>

                          <bdo id='QPWlt'></bdo><ul id='QPWlt'></ul>