jankratochvil added a comment.

In https://reviews.llvm.org/D47492#1117350, @labath wrote:

> it is implemented (in libstdc++ at least) using the swap trick too.


Thanks for the heads up, I expected it does `realloc()`: implementation 
absolutely cannot rely on realloc ... because realloc, if it cannot shrink 
in-place, will either leave the memory alone (no-op case) or make a bitwise 
copy (and miss the opportunity for readjusting pointers, etc. that the proper 
C++ copying/moving constructors would give) 
<https://stackoverflow.com/a/23513877/2995591>


Repository:
  rL LLVM

https://reviews.llvm.org/D47492



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to