This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/17780


I'd like to put this already big patch in, and then put in the tuning
optimizations for it next. There are some obvious simplifications that
can be done in _M_reserve block, where the operator new calls can be
coalesced. That's later though.

Found two things while testing this.

1) rope is leaking memory, at least rope-7 in the threads test. This is
regardless of allocator used. Since rope is kind of in an iffy state
right now, I'm not going to worry about this at the moment. I should
probably bugzilla this.

2) I'm seeing destruction ordering differences between icc and g++ for
some of the static local bits. I'll put a smaller testcase in bugzilla
about this tomorrow after I get a chance to investigate this a bit more.

tested x86/linux

2004-10-05  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/17780
	* include/ext/mt_allocator.h (__pool_base::_Tune): Add defaults
	options as compile-time constant enums.
	(__pool_base::_Tune::is_default): New.
	(__pool_base::_Block_address): New.
	(__pool_base): Rearrange data members.
	(__pool::_M_reserve_memory): To _M_reserve_block.
	(__pool::_M_reclaim_memory): To _M_reclaim_block.	
	(__pool::_Bin_record): Add _Block_address data member.
	(__pool<false>): Add _M_thread_freelist_initial.
	(__pool::~__pool): Declare.	
	(__common_pool_policy): Move static data member to...
	(__common_pool_policy::_S_get_pool): ...here, make static local.
	(__per_type_pool_policy): Move static data member to...
	(__per_type_pool_policy::_S_get_pool): ...here, make static local.
	(__mt_alloc::__mt_alloc): Call __policy_type::_S_get_pool.
	Remove static member definitions. Use define for __default_policy.
	* src/mt_allocator.cc: Same.
	* config/linker-map.gnu: Don't export _S_get_pool. Renames.
	* testsuite/ext/new_allocator: New.
	* testsuite/ext/new_allocator/instantiate.cc: New.
	* testsuite/ext/new_allocator/check_new.cc: New.
	* testsuite/ext/new_allocator/deallocate_global.cc: New.
	* testsuite/ext/new_allocator/deallocate_local.cc: New.
	* testsuite/ext/mt_allocator/instantiate.cc: Instantiate all
	template arguments.
	* testsuite/ext/mt_allocator/deallocate_global-1.cc: New.
	* testsuite/ext/mt_allocator/deallocate_global-2.cc: New.
	* testsuite/ext/mt_allocator/deallocate_global-3.cc: New.
	* testsuite/ext/mt_allocator/deallocate_global-4.cc: New.
	* testsuite/ext/mt_allocator/deallocate_local-1.cc: New.
	* testsuite/ext/mt_allocator/deallocate_local-2.cc: New.
	* testsuite/ext/mt_allocator/deallocate_local-3.cc: New.
	* testsuite/ext/mt_allocator/deallocate_local-4.cc: New.
	* testsuite/ext/mt_allocator/deallocate.cc: New.
	* testsuite/ext/malloc_allocator/deallocate.cc: New.	
	* testsuite/ext/malloc_allocator/deallocate_global.cc: New.
	* testsuite/ext/malloc_allocator/deallocate_local.cc: New.

Attachment: p.20041005.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]