aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/array_allocator.h
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-04 13:54:48 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-04 13:54:48 +0000
commited0c89e794b4ee13aadf6c42700d91a8a5da43bc (patch)
treed0964adef6a41f0707fc09b2e71e4c716c302552 /libstdc++-v3/include/ext/array_allocator.h
parent8c440ba305dc8aaeffe42d886687e19f7d007664 (diff)
* Merge from mainline (tree-profiling-merge-20050603)struct-reorg-merge-20050630tree-profiling-branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-profiling-branch@100586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/array_allocator.h')
-rw-r--r--libstdc++-v3/include/ext/array_allocator.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h
index 27169193306..8689d9da26a 100644
--- a/libstdc++-v3/include/ext/array_allocator.h
+++ b/libstdc++-v3/include/ext/array_allocator.h
@@ -121,10 +121,9 @@ namespace __gnu_cxx
allocate(size_type __n, const void* = 0)
{
static size_type __array_used;
- if (_M_array == 0
- || __array_used + __n > sizeof(*_M_array) / sizeof(_Tp))
+ if (_M_array == 0 || __array_used + __n > _M_array->size())
std::__throw_bad_alloc();
- pointer __ret = reinterpret_cast<_Tp*>(_M_array) + __array_used;
+ pointer __ret = _M_array->begin() + __array_used;
__array_used += __n;
return __ret;
}