]> granicus.if.org Git - gc/commit
Fix data race when getting object size in explicitly-typed allocators
authorIvan Maidanski <ivmai@mail.ru>
Fri, 10 Nov 2017 17:07:16 +0000 (20:07 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 18 Dec 2017 05:57:46 +0000 (08:57 +0300)
commita3eea4c39273bbab2482c885e073076782ce29b3
treee4854764e4a6e372b141b1da55252df79f11b2b6
parent483f767f88428fc87b88b78f76a2996368ef7bd7
Fix data race when getting object size in explicitly-typed allocators
(Cherry-pick commit eb33bda5 from 'release-7_6' branch.)

* typd_mlc.c (COMPLEX): Reformat comment.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed):
Always use BYTES_TO_GRANULES(GC_size(op)) instead of GC_size_map[lb] to
determine size of the allocated object in granules (because the value
of GC_size_map[lb] might be updated by another thread since the value
use in GC_malloc_kind); add comment.
typd_mlc.c