diff options
author | dim <dim@FreeBSD.org> | 2012-10-22 18:25:04 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-10-22 18:25:04 +0000 |
commit | 708d8e446e991358da23bb52ec5320440221f12f (patch) | |
tree | 3a061d75674cd5b60d9f6df45d0b8d755da3782f /contrib/libc++/src/debug.cpp | |
parent | b8c74d455d2690e710a0802a98a9d310995a52eb (diff) | |
parent | 13334223d751d249ccd6475b8cba36ff71ddc972 (diff) | |
download | FreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.zip FreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.tar.gz |
Import libc++ trunk r165949. Among other improvements and bug fixes,
this has many visibility problems fixed, which should help with
compiling certain ports that exercise C++11 mode (i.e. Firefox).
Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files,
which are referred to in all the source files.
MFC after: 1 month
Diffstat (limited to 'contrib/libc++/src/debug.cpp')
-rw-r--r-- | contrib/libc++/src/debug.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/libc++/src/debug.cpp b/contrib/libc++/src/debug.cpp index 406b247..b8af4dd 100644 --- a/contrib/libc++/src/debug.cpp +++ b/contrib/libc++/src/debug.cpp @@ -146,7 +146,11 @@ __libcpp_db::__insert_c(void* __c) size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1); __c_node** cbeg = (__c_node**)calloc(nc, sizeof(void*)); if (cbeg == nullptr) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_alloc(); +#else + abort(); +#endif for (__c_node** p = __cbeg_; p != __cend_; ++p) { __c_node* q = *p; @@ -167,7 +171,11 @@ __libcpp_db::__insert_c(void* __c) __c_node* p = __cbeg_[hc]; __c_node* r = __cbeg_[hc] = (__c_node*)malloc(sizeof(__c_node)); if (__cbeg_[hc] == nullptr) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_alloc(); +#else + abort(); +#endif r->__c_ = __c; r->__next_ = p; ++__csz_; @@ -402,7 +410,11 @@ __c_node::__add(__i_node* i) nc = 1; __i_node** beg = (__i_node**)malloc(nc * sizeof(__i_node*)); if (beg == nullptr) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_alloc(); +#else + abort(); +#endif if (nc > 1) memcpy(beg, beg_, nc/2*sizeof(__i_node*)); free(beg_); @@ -424,7 +436,11 @@ __libcpp_db::__insert_iterator(void* __i) size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1); __i_node** ibeg = (__i_node**)calloc(nc, sizeof(void*)); if (ibeg == nullptr) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_alloc(); +#else + abort(); +#endif for (__i_node** p = __ibeg_; p != __iend_; ++p) { __i_node* q = *p; @@ -445,7 +461,11 @@ __libcpp_db::__insert_iterator(void* __i) __i_node* p = __ibeg_[hi]; __i_node* r = __ibeg_[hi] = (__i_node*)malloc(sizeof(__i_node)); if (r == nullptr) +#ifndef _LIBCPP_NO_EXCEPTIONS throw bad_alloc(); +#else + abort(); +#endif ::new(r) __i_node(__i, p, nullptr); ++__isz_; return r; |