Summary: | [bmalloc] IsoHeap's initialization is racy with IsoHeap::isInitialized | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, dbates, ews-watchlist, fpizlo, ggaren, saam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Yusuke Suzuki
2019-06-19 18:39:31 PDT
Created attachment 372514 [details]
Patch
Comment on attachment 372514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372514&action=review Nice!!! r=me > Source/bmalloc/bmalloc/IsoHeapInlines.h:86 > + auto* heap = new IsoHeapImpl<Config>(); > + setAllocatorOffset(heap->allocatorOffset()); > + setDeallocatorOffset(heap->deallocatorOffset()); > + auto* atomic = reinterpret_cast<std::atomic<IsoHeapImpl<Config>*>*>(&m_impl); > + atomic->store(heap, std::memory_order_release); Can you comment on this ordering being important? (In reply to Saam Barati from comment #3) > Comment on attachment 372514 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=372514&action=review > > Nice!!! r=me > > > Source/bmalloc/bmalloc/IsoHeapInlines.h:86 > > + auto* heap = new IsoHeapImpl<Config>(); > > + setAllocatorOffset(heap->allocatorOffset()); > > + setDeallocatorOffset(heap->deallocatorOffset()); > > + auto* atomic = reinterpret_cast<std::atomic<IsoHeapImpl<Config>*>*>(&m_impl); > > + atomic->store(heap, std::memory_order_release); > > Can you comment on this ordering being important? And by important, I mean necessary. It'd just be good to briefly describe the protocol of stores/loads we're using Comment on attachment 372514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372514&action=review Thank you for your review! >>> Source/bmalloc/bmalloc/IsoHeapInlines.h:86 >>> + atomic->store(heap, std::memory_order_release); >> >> Can you comment on this ordering being important? > > And by important, I mean necessary. It'd just be good to briefly describe the protocol of stores/loads we're using Sounds really nice! I've added the comment here. Committed r246630: <https://trac.webkit.org/changeset/246630> |