Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Issue 651723003: Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope. (Closed)

Created:
6 years, 2 months ago by mtklein_C
Modified:
5 years, 10 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope. Function- or method- local scope isn't threadsafe; the pointer is generally zero-initialized on first use in function scope (i.e. lazily... we have to go deeper), but for globals we can be pretty sure the linker will do that for us. BUG=skia: No public API changes. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/148ec59001ca7d7e54aec580a048c6dd2a085991

Patch Set 1 #

Patch Set 2 : explain more #

Patch Set 3 : external linkage #

Patch Set 4 : external linkage #

Patch Set 5 : safe unref #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -46 lines) Patch
M include/core/SkData.h View 1 chunk +1 line, -2 lines 0 comments Download
M include/core/SkPathRef.h View 1 chunk +1 line, -1 line 0 comments Download
M include/ports/SkFontMgr.h View 1 chunk +1 line, -1 line 0 comments Download
M include/ports/SkRemotableFontMgr.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkData.cpp View 1 2 3 4 1 chunk +4 lines, -5 lines 0 comments Download
M src/core/SkFontHost.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M src/core/SkGlyphCache.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkImageFilter.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M src/core/SkLazyPtr.h View 1 1 chunk +6 lines, -3 lines 0 comments Download
M src/core/SkMessageBus.h View 2 chunks +9 lines, -12 lines 0 comments Download
M src/core/SkPathRef.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M src/core/SkTypeface.cpp View 1 2 3 2 chunks +11 lines, -9 lines 0 comments Download
M src/core/SkXfermode.cpp View 3 chunks +2 lines, -2 lines 0 comments Download
M src/fonts/SkRemotableFontMgr.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M src/lazy/SkDiscardableMemoryPool.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 38 (12 generated)
mtklein
6 years, 2 months ago (2014-10-13 15:52:36 UTC) #3
bungeman-skia
lgtm, do we have any more XXX_STATIC_XXX macros that need to be treated this way ...
6 years, 2 months ago (2014-10-13 16:31:31 UTC) #4
mtklein
On 2014/10/13 16:31:31, bungeman1 wrote: > lgtm, do we have any more XXX_STATIC_XXX macros that ...
6 years, 2 months ago (2014-10-13 17:53:12 UTC) #5
mtklein
On 2014/10/13 17:53:12, mtklein wrote: > On 2014/10/13 16:31:31, bungeman1 wrote: > > lgtm, do ...
6 years, 2 months ago (2014-10-13 18:02:10 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/651723003/170001
6 years, 2 months ago (2014-10-13 18:38:01 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot on client.skia.compile (http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot/builds/12) Build-Ubuntu13.10-GCC4.8-x86_64-Release-Trybot on client.skia.compile (http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-GCC4.8-x86_64-Release-Trybot/builds/23)
6 years, 2 months ago (2014-10-13 18:40:12 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/651723003/310001
6 years, 2 months ago (2014-10-13 19:07:33 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot on client.skia.compile (http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu13.10-GCC4.8-Arm7-Debug-Android-Trybot/builds/16)
6 years, 2 months ago (2014-10-13 19:10:46 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/651723003/420001
6 years, 2 months ago (2014-10-13 19:13:17 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot on client.skia (http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot/builds/15)
6 years, 2 months ago (2014-10-13 19:39:53 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/651723003/420001
6 years, 2 months ago (2014-10-13 19:46:46 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot on client.skia (http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot/builds/18)
6 years, 2 months ago (2014-10-13 20:00:30 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/651723003/550001
6 years, 2 months ago (2014-10-13 20:09:00 UTC) #24
commit-bot: I haz the power
Committed patchset #5 (id:550001) as 148ec59001ca7d7e54aec580a048c6dd2a085991
6 years, 2 months ago (2014-10-13 20:18:00 UTC) #25
brucedawson
I noticed this change because of some new variable shadowing warnings in the VC++ /analyze ...
5 years, 10 months ago (2015-02-09 18:38:01 UTC) #27
bungeman-skia
On 2015/02/09 18:38:01, brucedawson wrote: > I noticed this change because of some new variable ...
5 years, 10 months ago (2015-02-09 19:13:56 UTC) #28
Nico
On 2015/02/09 19:13:56, bungeman1 wrote: > On 2015/02/09 18:38:01, brucedawson wrote: > > I noticed ...
5 years, 10 months ago (2015-02-09 19:30:24 UTC) #29
mtklein
On 2015/02/09 19:13:56, bungeman1 wrote: > On 2015/02/09 18:38:01, brucedawson wrote: > > I noticed ...
5 years, 10 months ago (2015-02-09 19:30:40 UTC) #30
brucedawson
That's odd that the compiler was adding synchronization -- go figure. Anyway, this is the ...
5 years, 10 months ago (2015-02-09 19:32:38 UTC) #31
Nico
On 2015/02/09 19:30:40, mtklein wrote: > On 2015/02/09 19:13:56, bungeman1 wrote: > > On 2015/02/09 ...
5 years, 10 months ago (2015-02-09 19:41:09 UTC) #32
mtklein
> 2. The actual initialization of the local static. Intuitively, dthe compiler > adds a ...
5 years, 10 months ago (2015-02-09 19:53:19 UTC) #33
Nico
On 2015/02/09 19:53:19, mtklein wrote: > > 2. The actual initialization of the local static. ...
5 years, 10 months ago (2015-02-09 19:57:12 UTC) #34
mtklein
On 2015/02/09 19:57:12, Nico wrote: > On 2015/02/09 19:53:19, mtklein wrote: > > > 2. ...
5 years, 10 months ago (2015-02-09 20:02:08 UTC) #35
Nico
On 2015/02/09 20:02:08, mtklein wrote: > On 2015/02/09 19:57:12, Nico wrote: > > On 2015/02/09 ...
5 years, 10 months ago (2015-02-09 21:00:47 UTC) #36
mtklein
On 2015/02/09 21:00:47, Nico wrote: > On 2015/02/09 20:02:08, mtklein wrote: > > On 2015/02/09 ...
5 years, 10 months ago (2015-02-09 21:09:09 UTC) #37
Nico
5 years, 10 months ago (2015-02-09 23:42:10 UTC) #38
Message was sent while issue was closed.
I'd be really interested in seeing an example where this guard variable is
initialized, by the way. (I asked a local compiler expert who thought that no
compiler (out of gcc, clang, cl) would add a guard bool for zero-initialized
local statics.)

Powered by Google App Engine
This is Rietveld 408576698