DescriptionAdd a 'unique' method to SkRefCnt, document the usage, and add support.
std::shared_ptr has a method called 'unique' which captures the concept that
a reference count of 1 is special, and can be used to optimize copy on write.
It also has some undocumented need for memory barriers in certain situations
and those needs are documented here.
The motivation for looking into this is crbug.com/258499 . The use of the
reference count in this manner is a benign race with both ref() and unref().
By introducing sk_atomic_unprotected_read, it is possible for Chromium to
annotate this read to tell ThreadSanitizer that this is known.
R=bsalomon@google.com
Committed: https://code.google.com/p/skia/source/detail?r=10221
Patch Set 1 #Patch Set 2 : #
Total comments: 12
Patch Set 3 : Organize things so that they can be fixed. #Patch Set 4 : Organize things so that they can be fixed. #Patch Set 5 : Update comments. #
Messages
Total messages: 10 (0 generated)
|