Workaround TSan false positives in extend_size_map
authorIvan Maidanski <ivmai@mail.ru>
Wed, 15 Nov 2017 22:15:14 +0000 (01:15 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 15 Nov 2017 22:15:14 +0000 (01:15 +0300)
commite522d6d791680b55825b5f11a4c082eb4770ecf5
tree36d644c42aa684b9a87d0e2d90b91fc6e62c271f
parent1e4e2cc93b5bead46518ce8028535492da662690
Workaround TSan false positives in extend_size_map

Thread Sanitizer reports data races between fill_size_map (called from
GC_extend_size_map) and GC_gcj_malloc[_ignore_off_page],
GC_malloc_kind_global, GC_generic_malloc_uncollectable,
GC_malloc_explicitly_typed_ignore_off_page which read a value from
GC_size_map before acquiring the allocation lock.  These races could
be ignored as the value is verified after acquiring the lock.

* alloc.c: Refine comment about GC_allocobj (and GC_size_map) usage
for the case of a multi-threaded environment.
* malloc.c (fill_size_map): New static function (with
GC_ATTR_NO_SANITIZE_THREAD attribute).
* malloc.c (GC_extend_size_map): Use fill_size_map() to fill in
a region of GC_size_map.
alloc.c
malloc.c