WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
205723
[WTF] Allow MediaTime static constants
https://bugs.webkit.org/show_bug.cgi?id=205723
Summary
[WTF] Allow MediaTime static constants
Alicia Boya García
Reported
2020-01-03 06:58:41 PST
Despite all its convenience methods, at its core MediaTime is a rather trivial class with only integral members. Despite this, since it had a destructor declared, this made the class non-trivially destructible even if the implementation was empty, and therefore clang did not allow to use it for static variables unless done in form of a pointer. By removing the destructor this restriction is lifted and we don't need heap allocations for static MediaTime objects. Previous usages of heap allocation for static MediaTime objects have been rewritten to take advantage of this. Test coverage is provided by successful compilation without [-Werror,-Wexit-time-destructors] errors and existing tests.
Attachments
Patch
(4.22 KB, patch)
2020-01-03 07:02 PST
,
Alicia Boya García
no flags
Details
Formatted Diff
Diff
Patch
(6.39 KB, patch)
2020-01-06 10:12 PST
,
Alicia Boya García
no flags
Details
Formatted Diff
Diff
Patch
(7.41 KB, patch)
2020-01-07 06:13 PST
,
Alicia Boya García
no flags
Details
Formatted Diff
Diff
Patch
(8.00 KB, patch)
2020-01-07 08:00 PST
,
Alicia Boya García
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Alicia Boya García
Comment 1
2020-01-03 07:02:37 PST
Created
attachment 386680
[details]
Patch
Darin Adler
Comment 2
2020-01-03 19:40:25 PST
Comment on
attachment 386680
[details]
Patch Great change! Looks like getting rid of the destructor helped the compiler notice quite a few unused MediaTime variables so need to fix those too. Also seems like this points to the direction where we could make this class compatible with constexpr so more of it could be evaluated at compile time.
Alicia Boya García
Comment 3
2020-01-06 10:12:22 PST
Created
attachment 386859
[details]
Patch
Darin Adler
Comment 4
2020-01-06 13:26:13 PST
Comment on
attachment 386859
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=386859&action=review
> Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm:478 > + (void) endTime; // Only used for logs, we need this to avoid "unused variable" errors in Release.
Even better solution: #if !LOG_DISABLED MediaTime endTime = PAL::toMediaTime(CMBufferQueueGetEndPresentationTimeStamp(m_producerQueue.get())); #endif
Alicia Boya García
Comment 5
2020-01-07 06:13:15 PST
Created
attachment 386963
[details]
Patch
Alicia Boya García
Comment 6
2020-01-07 08:00:43 PST
Created
attachment 386973
[details]
Patch
WebKit Commit Bot
Comment 7
2020-01-08 07:57:10 PST
Comment on
attachment 386973
[details]
Patch Clearing flags on attachment: 386973 Committed
r254200
: <
https://trac.webkit.org/changeset/254200
>
WebKit Commit Bot
Comment 8
2020-01-08 07:57:12 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9
2020-01-08 07:58:14 PST
<
rdar://problem/58408671
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug