Bug 154691 - Should template RefCounter instead of RefCounter::Token
Summary: Should template RefCounter instead of RefCounter::Token
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-25 13:49 PST by Gavin Barraclough
Modified: 2016-02-25 16:45 PST (History)
0 users

See Also:


Attachments
Fix (26.75 KB, patch)
2016-02-25 13:57 PST, Gavin Barraclough
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2016-02-25 13:49:56 PST
My real goal here is to make the counter accurate. Currently returning a Token from token<>() results in ref-count churn. Fixing this either means changing the return value, or improving Token (which will probably mean replacing it with RefPtr). Either way would break the current type checking. Move type tag to RefCount so this can still be enforced.
Comment 1 Gavin Barraclough 2016-02-25 13:57:24 PST
Created attachment 272235 [details]
Fix
Comment 2 Anders Carlsson 2016-02-25 14:15:33 PST
Comment on attachment 272235 [details]
Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=272235&action=review

> Source/WTF/wtf/RefCounter.h:172
> +inline typename RefCounter<T>::Token& RefCounter<T>::Token::operator=(const RefCounter<T>::Token& token)

I think this can be

inline auto RefCounter<T>::Token::operator=(const RefCounter<T>::Token& token) -> Token&
Comment 3 Gavin Barraclough 2016-02-25 14:58:02 PST
Transmitting file data ................
Committed revision 197132.
Comment 4 Gavin Barraclough 2016-02-25 16:45:48 PST
Speculative windows fix:
Transmitting file data ..
Committed revision 197146.