[cfe-dev] Curious about libcxx __libcpp_nmstr design

Yaron Keren yaron.keren at gmail.com
Wed Oct 9 05:59:21 PDT 2013


Thanks, I see, it's binary compatible with libstdc++ basic_string.

BTW, MingW libstdc++ standard DLL build statically links libsupc++ so it's
not replaceable. If libcxxabi.dll is also around, two copies of the ABI
will exist linked at the same time to different parts of the programs.

I'm trying to build libcxx + libcxxabi combined.



2013/10/9 Howard Hinnant <howard.hinnant at gmail.com>

> On Oct 8, 2013, at 1:35 PM, Yaron Keren <yaron.keren at gmail.com> wrote:
>
> > I have couple of questions about __libcpp_nmstr class design.
> >
> > It's a reference counted char* class optimized for size, right?
> >
> > Why is this so important to optimize this class size to the absolute
> minimum?
> >
> > What is the purpose of the two unused_t? (I understand they are named
> unused...)
> > Why they are assigned the string length if never used?
>
> libcxx/libcxxabi were created as replacements for gcc's-4.2 libstdc++.
>  The intent is that all exception classes defined in <stdexcept> be ABI
> compatible with libstdc++-4.2 so that if an application found itself using
> both libc++ and libstdc++ (indirectly via various dylibs) that a
> std-defined exception propagated by one library could be caught by another,
> without worry about whether either library was linked against libstdc++ or
> libc++.  In most recent work, the definitions for these types have migrated
> to libc++abi (http://libcxxabi.llvm.org), so that libc++abi can serve
> both libc++ and libstdc++, assuming libstdc++ has been ported to run on top
> of libc++abi.
>
> Howard
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131009/0424f139/attachment.html>


More information about the cfe-dev mailing list