Closed
Bug 757933
Opened 12 years ago
Closed 12 years ago
Switch nsRegionAllocator to ThreadLocal and avoid extra library call
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: romaxa, Assigned: romaxa)
References
Details
Attachments
(2 files, 1 obsolete file)
3.08 KB,
patch
|
romaxa
:
review+
|
Details | Diff | Splinter Review |
3.16 KB,
patch
|
Details | Diff | Splinter Review |
Possibly similar to 756439, I think it make sense to switch Regions to ThreadLocal and avoid nspr calls for multiple region operations
Assignee | ||
Comment 1•12 years ago
|
||
Comment 2•12 years ago
|
||
Comment on attachment 626529 [details] [diff] [review] NSPR TLS to ThreadLocal fast call Cehcking with Ehsan to make sure we're good with using this throughout the code base instead of nspr.
Attachment #626529 -
Flags: review?(ehsan)
Attachment #626529 -
Flags: review?(bgirard)
Attachment #626529 -
Flags: review+
Comment 3•12 years ago
|
||
Comment on attachment 626529 [details] [diff] [review] NSPR TLS to ThreadLocal fast call Review of attachment 626529 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the static_casts below removed. ::: gfx/src/nsRegion.cpp @@ +188,5 @@ > > void RgnRectMemoryAllocatorDTOR(void *priv) > { > RgnRectMemoryAllocator* allocator = (static_cast<RgnRectMemoryAllocator*>( > + gRectPoolTlsIndex.get())); You should not need the cast here and below.
Attachment #626529 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Static cast removed, and added shutdown
Attachment #626529 -
Attachment is obsolete: true
Attachment #626540 -
Flags: review+
Assignee | ||
Comment 5•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f93e4add42b
Updated•12 years ago
|
Flags: in-testsuite-
Target Milestone: --- → mozilla15
Comment 6•12 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/f2ec7e8407e5 - either this or you patch for bug 757380 was hitting mochitest-4 assertions like https://tbpl.mozilla.org/php/getParsedLog.php?id=12048582&tree=Mozilla-Inbound&full=1
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 7•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5baac057fc1a
Keywords: checkin-needed
Comment 8•12 years ago
|
||
And backed out for bustage. https://hg.mozilla.org/integration/mozilla-inbound/rev/be42b12c6092 https://tbpl.mozilla.org/php/getParsedLog.php?id=12096646&tree=Mozilla-Inbound ../../../gfx/src/nsRegion.cpp: In function 'void RgnRectMemoryAllocatorDTOR(void*)': ../../../gfx/src/nsRegion.cpp:191:61: error: cannot convert 'RgnRectMemoryAllocator' to 'RgnRectMemoryAllocator*' in initialization ../../../gfx/src/nsRegion.cpp: In static member function 'static void nsRegion::ShutdownStatic()': ../../../gfx/src/nsRegion.cpp:202:61: error: cannot convert 'RgnRectMemoryAllocator' to 'RgnRectMemoryAllocator*' in initialization ../../../gfx/src/nsRegion.cpp: In static member function 'static void* nsRegion::RgnRect::operator new(size_t)': ../../../gfx/src/nsRegion.cpp:213:61: error: cannot convert 'RgnRectMemoryAllocator' to 'RgnRectMemoryAllocator*' in initialization ../../../gfx/src/nsRegion.cpp:216:36: error: no matching function for call to 'mozilla::ThreadLocal<RgnRectMemoryAllocator>::set(RgnRectMemoryAllocator*&)' ../../dist/include/mozilla/ThreadLocal.h:125:1: note: candidate is: bool mozilla::ThreadLocal<T>::set(T) [with T = RgnRectMemoryAllocator] ../../../gfx/src/nsRegion.cpp: In static member function 'static void nsRegion::RgnRect::operator delete(void*, size_t)': ../../../gfx/src/nsRegion.cpp:223:61: error: cannot convert 'RgnRectMemoryAllocator' to 'RgnRectMemoryAllocator*' in initialization In file included from ../../../gfx/src/nsRegion.cpp:8:0: ../../dist/include/mozilla/ThreadLocal.h: At global scope: ../../dist/include/mozilla/ThreadLocal.h: In instantiation of 'mozilla::ThreadLocal<RgnRectMemoryAllocator>::Helper': ../../dist/include/mozilla/ThreadLocal.h:114:10: instantiated from 'T mozilla::ThreadLocal<T>::get() const [with T = RgnRectMemoryAllocator]' ../../../gfx/src/nsRegion.cpp:191:61: instantiated from here ../../dist/include/mozilla/ThreadLocal.h:77:9: error: member 'RgnRectMemoryAllocator mozilla::ThreadLocal<RgnRectMemoryAllocator>::Helper::value' with constructor not allowed in union ../../dist/include/mozilla/ThreadLocal.h:77:9: error: member 'RgnRectMemoryAllocator mozilla::ThreadLocal<RgnRectMemoryAllocator>::Helper::value' with destructor not allowed in union ../../dist/include/mozilla/ThreadLocal.h: In member function 'bool mozilla::ThreadLocal<T>::init() [with T = RgnRectMemoryAllocator]': ../../../gfx/src/nsRegion.cpp:197:33: instantiated from here ../../dist/include/mozilla/ThreadLocal.h:99:3: error: static assertion failed: "mozilla::ThreadLocal can\'t be used for types larger than a pointer"
Target Milestone: mozilla15 → ---
Assignee | ||
Comment 9•12 years ago
|
||
After bug 756965 landed, patch need update -mozilla::ThreadLocal<RgnRectMemoryAllocator> gRectPoolTlsIndex; +mozilla::ThreadLocal<RgnRectMemoryAllocator*> gRectPoolTlsIndex; Here is try build for last patch https://tbpl.mozilla.org/?tree=Try&rev=c30e13ce681c
Assignee | ||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/34c3bcd58f3b
Updated•12 years ago
|
Target Milestone: --- → mozilla15
Comment 11•12 years ago
|
||
Original landing and backout: https://hg.mozilla.org/mozilla-central/rev/5baac057fc1a https://hg.mozilla.org/mozilla-central/rev/be42b12c6092 Relanded: https://hg.mozilla.org/mozilla-central/rev/34c3bcd58f3b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•