summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-02-26 23:27:21 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-02-26 23:42:57 +0300
commit16c55506c5222ef40eba1e4aedf200358421080d (patch)
tree5b7fc23b26192fde86c9a17b35ef2b68271326f3 /malloc.c
parent272283d5b0ebf35326187c12973ee540c19eae67 (diff)
downloadbdwgc-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.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/malloc.c b/malloc.c
index b62fd3ea..25ca72f7 100644
--- a/malloc.c
+++ b/malloc.c
@@ -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. */