diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-02-26 23:27:21 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-26 23:42:57 +0300 |
commit | 16c55506c5222ef40eba1e4aedf200358421080d (patch) | |
tree | 5b7fc23b26192fde86c9a17b35ef2b68271326f3 /malloc.c | |
parent | 272283d5b0ebf35326187c12973ee540c19eae67 (diff) | |
download | bdwgc-16c55506c5222ef40eba1e4aedf200358421080d.tar.gz |
Revert 'Workaround TSan false positives in extend_size_map'
This reverts commit e522d6d791680b55825b5f11a4c082eb4770ecf5.
Because there is again a data race here, not a false positive,
though it is again not likely to fail in practice.
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -102,18 +102,6 @@ STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags) return result; } -/* This function should be called with the allocation lock held. */ -/* At the same time, it is safe to get a value from GC_size_map not */ -/* acquiring the allocation lock provided the obtained value is used */ -/* according to the pattern given in alloc.c file (see the comment */ -/* about GC_allocobj usage and, e.g., GC_malloc_kind_global code). */ -GC_ATTR_NO_SANITIZE_THREAD -static void fill_size_map(size_t low_limit, size_t byte_sz, size_t granule_sz) -{ - for (; low_limit <= byte_sz; low_limit++) - GC_size_map[low_limit] = granule_sz; -} - /* Fill in additional entries in GC_size_map, including the i-th one. */ /* Note that a filled in section of the array ending at n always */ /* has the length of at least n/4. */ @@ -163,7 +151,8 @@ STATIC void GC_extend_size_map(size_t i) /* We may need one extra byte; do not always */ /* fill in GC_size_map[byte_sz]. */ - fill_size_map(low_limit, byte_sz, granule_sz); + for (; low_limit <= byte_sz; low_limit++) + GC_size_map[low_limit] = granule_sz; } /* Allocate lb bytes for an object of kind k. */ |