This is the mail archive of the libstdc++-cvs@gcc.gnu.org mailing list for the libstdc++ 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]

r189633 - in /branches/google/gcc-4_6-mobile/vt...


Author: ctice
Date: Wed Jul 18 20:06:23 2012
New Revision: 189633

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189633
Log:
Fix various multi-threading issues; put hash mask
directly into the hash table data (at offset -1).

2012-07-18  Caroline Tice  <cmtice@google.com>

	* libstdc++-v3/libsupc++/vtv_rts.cc (__VLTRegisterPair):  Add
	static mutex variable, protected, and statically initialize it.
	Add volatile pointer variable to contain address of vtable_map var, to
	force re-evaluation on second read. Lock mutex before calls
	vlt_hash_init_table, and unlock it afterwards, to prevent two threads
	trying to initialize the same vtable map variable at the same time.
	* libstdc++-v3/libsupc++/vtv_threaded_hash.cc (rehash_elements):
	Remove unused parameter new_size. Add format to constant when
	calculating hash mask.
	(grow_table): Reformat comment.  Increase table size by 1, to allow
	for hash mask.  Put hash mask in first element of table.  Add hash
	mask explanatory comments.  Make main table start at second element.
	Add  format to constant when calculating hash mask.
	(vlt_hash_init_table):  Ditto.
	(vlt_hash_insert):  Look for hash mask directly in data table.  Use
	size rather than hash mask to check if table changed.  Enforce FSF
	guidelines: indent curly braces and limit lines to 80 chars. Updated
	some comments.
	(dump_table_to_file):  Read hash mask from table.
	* libstdc++-v3/libsupc++/vtv_threaded_hash.h (struct vlt_hashtable):
	Remove hash_mask field. Make data_size and data volatile.
	(vlt_hash_find): Only access table pointer once (read and store it);
	read hash mask directly from table.




Modified:
    branches/google/gcc-4_6-mobile/vtable-security/libstdc++-v3/libsupc++/vtv_rts.cc
    branches/google/gcc-4_6-mobile/vtable-security/libstdc++-v3/libsupc++/vtv_threaded_hash.cc
    branches/google/gcc-4_6-mobile/vtable-security/libstdc++-v3/libsupc++/vtv_threaded_hash.h

Changes in other areas also in this revision:
Modified:
    branches/google/gcc-4_6-mobile/vtable-security/ChangeLog.vtable-security


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