aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/mt_allocator.h
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2004-10-17 15:22:03 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2004-10-17 15:22:03 +0000
commit7befac71407d4fd95853d0efd43f5c1d37e66866 (patch)
treee552abb6f5cc931e88759b81d1278e93aa6faa6e /libstdc++-v3/include/ext/mt_allocator.h
parenta815571193ab94a7821e6c9615af311f060bce2f (diff)
downloadgcc-7befac71407d4fd95853d0efd43f5c1d37e66866.zip
gcc-7befac71407d4fd95853d0efd43f5c1d37e66866.tar.gz
gcc-7befac71407d4fd95853d0efd43f5c1d37e66866.tar.bz2
mt_allocator.h (__pool::_M_get_align): New.
2004-10-17 Benjamin Kosnik <bkoz@redhat.com> * include/ext/mt_allocator.h (__pool::_M_get_align): New. (__mt_alloc::allocate): Use it. * src/mt_allocator.cc (__pool::_M_reclaim_block): Use it. (__pool::_M_reserve_block): Simplify block allocation. From-SVN: r89171
Diffstat (limited to 'libstdc++-v3/include/ext/mt_allocator.h')
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index d4d51d8..5e587ad 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -169,6 +169,10 @@ namespace __gnu_cxx
_M_get_binmap(size_t __bytes)
{ return _M_binmap[__bytes]; }
+ const size_t
+ _M_get_align()
+ { return _M_options._M_align; }
+
explicit __pool_base()
: _M_options(_Tune()), _M_binmap(NULL), _M_init(false) { }
@@ -708,8 +712,7 @@ namespace __gnu_cxx
__bin._M_first[__thread_id] = __block->_M_next;
__pool._M_adjust_freelist(__bin, __block, __thread_id);
- const __pool_base::_Tune& __options = __pool._M_get_options();
- __c = reinterpret_cast<char*>(__block) + __options._M_align;
+ __c = reinterpret_cast<char*>(__block) + __pool._M_get_align();
}
else
{