<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>On 8/8/2014 5:46 PM, T Stutts wrote:</tt><tt><br>
    </tt>
    <blockquote
cite="mid:CADPorxCRsrZt87Yp8pXANTqZyOT6KcWXf0q23x2CAxLD=nFEnw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <p style="margin: 5px 0px 10px; padding: 0px 0px 10px;
          font-size: 13px; word-wrap: break-word; color: rgb(54, 53,
          52); line-height: 16.9px;"><tt>Hi,</tt><tt><br>
          </tt><tt>This is a copy of my post at </tt><tt><a
              moz-do-not-send="true"
              href="http://qt-project.org/forums/viewthread/46102/">http://qt-project.org/forums/viewthread/46102/</a></tt><tt>
            and I am taking the replied suggestion of asking the mailing
            list. I hope the copy/pasted markup is okay.</tt><tt><br>
          </tt>
        </p>
        <p style="margin: 5px 0px 10px; padding: 0px 0px 10px;
          font-size: 13px; word-wrap: break-word; color: rgb(54, 53,
          52); line-height: 16.9px;"><tt>What does </tt><tt><a
              moz-do-not-send="true"
href="https://qt.gitorious.org/qt/digia-qt/source/705b0f958a6071341b10cbd51917e1378356491b:src/corelib/tools/qvarlengtharray.h#L194this"
style="margin:0px;padding:0px;color:rgb(68,165,28);text-decoration:none">this
              line</a></tt><tt> </tt><tt><em
              style="margin:0px;padding:0px">[<a moz-do-not-send="true"
                href="http://qt.gitorious.org">qt.gitorious.org</a>]</em></tt><tt> line
            do?</tt><tt><br style="margin:0px;padding:0px">
          </tt><tt>
            I am referring to the line</tt></p>
        <div class="" style="margin: 0px; padding: 0px; color: rgb(54,
          53, 52); font-size: 13px; line-height: 16.9px;">
          <ol style="margin:1em 0px;padding:5px
            0px;list-style-position:inside;color:rgb(175,175,175)">
            <li class="" style="margin: 0px 0px 0px 32px; padding: 0px
              0px 0px 12px; list-style: decimal outside none;
              line-height: 14px; border-left: 3px solid rgb(108, 226,
              108); background-image: none;">
              <div class="" style="margin: 0px; padding: 0px; color:
                rgb(0, 0, 0);"><tt><span class=""
                    style="margin:0px;padding:0px;color:rgb(210,0,32);font-weight:bold">new</span></tt><tt> </tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span></tt><tt>ptr</tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">+</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span></tt><tt>s</tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">++</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></tt><tt> T</tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">(</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">*</span></tt><tt>abuf</tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">++</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">)</span></tt><tt><span
                    class=""
                    style="margin:0px;padding:0px;color:rgb(54,53,52)">;</span></tt></div>
            </li>
          </ol>
        </div>
        <tt>[...]</tt><tt><br>
        </tt>
        <p style="margin: 5px 0px 10px; padding: 0px 0px 10px;
          font-size: 13px; word-wrap: break-word; color: rgb(54, 53,
          52); line-height: 16.9px;">
        </p>
        <p style="margin: 5px 0px 10px; padding: 0px 0px 10px;
          font-size: 13px; word-wrap: break-word; color: rgb(54, 53,
          52); line-height: 16.9px;"><tt>It looks to me like an explicit
            memory leak (</tt><tt><a moz-do-not-send="true"
              href="http://en.cppreference.com/w/cpp/language/new"
              style="margin:0px;padding:0px;color:rgb(68,165,28);text-decoration:none">see
              new()</a></tt><tt> </tt><tt><em
              style="margin:0px;padding:0px">[<a moz-do-not-send="true"
                href="http://en.cppreference.com">en.cppreference.com</a>]</em></tt><tt>). </tt><tt><br
              style="margin:0px;padding:0px">
          </tt><tt>
            It expressly allocates dynamic memory and does not store the
            pointer anywhere, unless Qt has its own allocation
            implementation (ie </tt><tt><a moz-do-not-send="true"
              href="http://en.cppreference.com/w/cpp/memory/new/set_new_handler"
style="margin:0px;padding:0px;color:rgb(68,165,28);text-decoration:none">set_new_handler()</a></tt><tt><em
              style="margin:0px;padding:0px">[<a moz-do-not-send="true"
                href="http://en.cppreference.com">en.cppreference.com</a>]</em></tt><tt>).</tt></p>
      </div>
    </blockquote>
    <tt><br>
    </tt><tt>I've not looked at the code, but that does seem to be a
      non-standard use of the keyword.  So it could be a custom "new"
      that Qt uses, or -- I've never seen it used before -- it might be
      the "placement" form of the C++ new operator[1]:</tt><tt><br>
    </tt>
    <blockquote><tt>placement (3)</tt>
      <pre><font face="Courier New, Courier, monospace">void* operator new (std::size_t size, void* ptr) throw();</font>
</pre>
      <tt>Simply returns </tt><tt><var>ptr</var></tt><tt> (no storage
        is allocated).</tt><tt><br>
      </tt><tt>
        Notice though that, if the function is called by a </tt><tt><i>new-expression</i></tt><tt>,
        the proper initialization will be performed (for class objects,
        this includes calling its default constructor).</tt><tt><br>
      </tt></blockquote>
    <tt>Just guessing.  :)<br>
      <br>
    </tt><tt>[1] <a class="moz-txt-link-freetext" href="http://www.cplusplus.com/reference/new/operator%20new/">http://www.cplusplus.com/reference/new/operator%20new/</a></tt><tt><br>
    </tt>
  </body>
</html>