diff --git a/runtime/mem/region_allocator-inl.h b/runtime/mem/region_allocator-inl.h index 0f98d28e94409c296b5a3dcf82353951202a4474..1b43d68219dcd40c48d9f94d98bd11bb8043663b 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); }