From 97b54814bce99dbc764a0aaf730b634be6166554 Mon Sep 17 00:00:00 2001 From: Panferov Ivan Date: Fri, 20 Oct 2023 16:58:56 +0300 Subject: [PATCH] Fix issue with store buffering in RegionAllocator Signed-off-by: Panferov Ivan --- runtime/mem/region_allocator-inl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/mem/region_allocator-inl.h b/runtime/mem/region_allocator-inl.h index 0f98d28e9..1b43d6821 100644 --- a/runtime/mem/region_allocator-inl.h +++ b/runtime/mem/region_allocator-inl.h @@ -154,7 +154,9 @@ void *RegionAllocator::AllocRegular(size_t align_size Region *region = this->template CreateAndSetUpNewRegion(REGION_SIZE, REGION_TYPE); if (LIKELY(region != nullptr)) { - mem = region->template Alloc(align_size); + // Here we need memory barrier to make the allocation visible + // in all threads before SetCurrentRegion + mem = region->template Alloc(align_size); SetCurrentRegion(region); } -- Gitee