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

Issue 99483003: Make leak counters thread-safe (Closed)

Created:
7 years ago by Kimmo Kinnunen
Modified:
6 years, 11 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Make leak counters thread-safe and turn them on by default for Debug Make leak counters implemented with SK_DECLARE_INST_COUNT thread-safe. Enable the leak counting for Debug builds when Skia is built as a static library. Having SK_DECLARE_INST_COUNT without SK_DEFINE_INST_COUNT relies on static variables in member functions declared in the header files. These might be duplicated in the clients of the library when Skia is built as a dynamic library, producing incorrect operation. Protect the instance counter initialization step (initStep) by using SkOnce. Makes SkOnce.h part of the public API, since SkInstCnt is public. Protect the per-class child list shared variable with a per-class mutex. Changes the behavior in the way that if the child list has been "cleaned up", it will still try to create subsequent child lists. BUG=skia:1219 Committed: http://code.google.com/p/skia/source/detail?r=13120

Patch Set 1 #

Total comments: 5

Patch Set 2 : address review comments #

Patch Set 3 : aling some slashes #

Total comments: 2

Patch Set 4 : address review comments #

Patch Set 5 : remove SkPostConfig hunk #

Patch Set 6 : re-enable instance counting #

Patch Set 7 : compile fix #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : rebaes #

Patch Set 11 : revert #

Patch Set 12 : enable only for static builds #

Patch Set 13 : bug# #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -172 lines) Patch
M gm/colormatrix.cpp View 1 11 2 chunks +3 lines, -3 lines 0 comments Download
M gm/convexpaths.cpp View 1 11 2 chunks +3 lines, -3 lines 0 comments Download
M gyp/core.gypi View 1 2 3 4 5 6 7 8 9 11 2 chunks +1 line, -1 line 0 comments Download
M include/core/SkInstCnt.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +28 lines, -13 lines 0 comments Download
A + include/core/SkOnce.h View 1 11 0 chunks +-1 lines, --1 lines 0 comments Download
M include/core/SkPostConfig.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -3 lines 0 comments Download
D src/core/SkOnce.h View 1 2 3 4 5 6 7 8 9 11 1 chunk +0 lines, -150 lines 0 comments Download

Messages

Total messages: 42 (0 generated)
Kimmo Kinnunen
Would not need the problems with the cleanup if the list would be linked list.. ...
7 years ago (2013-12-04 13:09:19 UTC) #1
Kimmo Kinnunen
Depends on https://codereview.chromium.org/98703002/
7 years ago (2013-12-04 13:10:01 UTC) #2
robertphillips
This looks good to me (and preferable to ripping it all out). I am adding ...
7 years ago (2013-12-04 14:01:22 UTC) #3
bsalomon
https://codereview.chromium.org/99483003/diff/1/include/core/SkInstCnt.h File include/core/SkInstCnt.h (right): https://codereview.chromium.org/99483003/diff/1/include/core/SkInstCnt.h#newcode47 include/core/SkInstCnt.h:47: static bool gInited; \ Perhaps we should use SK_DECLARE_STATIC_ONCE()/SkOnce() ...
7 years ago (2013-12-04 15:04:18 UTC) #4
robertphillips
I retract the "(and preferable to ripping it all out)" comment earlier - I hadn't ...
7 years ago (2013-12-04 15:17:29 UTC) #5
bungeman-skia
1) Use SkOnce, it's just as fast as this, but correct. 2) I don't see ...
7 years ago (2013-12-04 15:24:44 UTC) #6
Kimmo Kinnunen
> 2) I don't see any changes in this CL around decrementing? That's intentional? Both ...
7 years ago (2013-12-05 08:03:22 UTC) #7
mtklein
https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h File include/core/SkInstCnt.h (right): https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h#newcode112 include/core/SkInstCnt.h:112: SkAutoMutexAcquire ama(SkGetInstCntAddInstChildMutex()); \ Does this one really need to ...
7 years ago (2013-12-05 16:06:53 UTC) #8
Kimmo Kinnunen
https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h File include/core/SkInstCnt.h (right): https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h#newcode112 include/core/SkInstCnt.h:112: SkAutoMutexAcquire ama(SkGetInstCntAddInstChildMutex()); \ On 2013/12/05 16:06:54, mtklein wrote: > ...
7 years ago (2013-12-09 07:54:51 UTC) #9
mtklein
On 2013/12/09 07:54:51, kkinnunen wrote: > https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h > File include/core/SkInstCnt.h (right): > > https://codereview.chromium.org/99483003/diff/40001/include/core/SkInstCnt.h#newcode112 > ...
7 years ago (2013-12-10 14:48:41 UTC) #10
Kimmo Kinnunen
On 2013/12/10 14:48:41, mtklein wrote: > On 2013/12/09 07:54:51, kkinnunen wrote: > > On 2013/12/05 ...
7 years ago (2013-12-11 07:03:30 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/99483003/60001
7 years ago (2013-12-11 07:03:49 UTC) #12
commit-bot: I haz the power
Presubmit check for 99483003-60001 failed and returned exit status 1. Running presubmit commit checks ...
7 years ago (2013-12-11 07:03:53 UTC) #13
Kimmo Kinnunen
Mike, would it be possible for you to look this one last time? I made ...
7 years ago (2013-12-11 07:21:44 UTC) #14
robertphillips
Chrome explicitly sets SK_ENABLE_INST_COUNT to 0 so leaving it on in debug won't impact them. ...
7 years ago (2013-12-11 12:47:12 UTC) #15
Kimmo Kinnunen
On 2013/12/11 12:47:12, robertphillips wrote: > Chrome explicitly sets SK_ENABLE_INST_COUNT to 0 so leaving it ...
7 years ago (2013-12-11 12:59:57 UTC) #16
bsalomon
On 2013/12/11 12:59:57, kkinnunen wrote: > On 2013/12/11 12:47:12, robertphillips wrote: > > Chrome explicitly ...
7 years ago (2013-12-11 15:46:30 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/99483003/90001
7 years ago (2013-12-12 06:15:59 UTC) #18
commit-bot: I haz the power
Failed to apply the patch. svn: Commit failed (details follow): svn: Temporarily unavailable
7 years ago (2013-12-12 06:24:33 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/99483003/90001
7 years ago (2013-12-12 13:25:24 UTC) #20
commit-bot: I haz the power
Change committed as 12635
7 years ago (2013-12-12 14:00:18 UTC) #21
robertphillips
This was reverted in r12637 due to compile errors on Mac 10.6 and in Chrome. ...
7 years ago (2013-12-12 14:27:40 UTC) #22
Kimmo Kinnunen
> This was reverted in r12637 due to compile errors on Mac 10.6 and in ...
7 years ago (2013-12-13 14:00:30 UTC) #23
robertphillips
should be re-opened
7 years ago (2013-12-13 14:01:51 UTC) #24
robertphillips
Let's see if the threading/SkOnce guys have any insight into the Windows issue.
7 years ago (2013-12-13 14:02:48 UTC) #25
bungeman-skia
On 2013/12/13 14:02:48, robertphillips wrote: > Let's see if the threading/SkOnce guys have any insight ...
7 years ago (2013-12-13 16:34:40 UTC) #26
bungeman-skia
On 2013/12/13 16:34:40, bungeman1 wrote: > On 2013/12/13 14:02:48, robertphillips wrote: > > Let's see ...
7 years ago (2013-12-13 17:23:35 UTC) #27
mtklein
On 2013/12/13 17:23:35, bungeman1 wrote: > On 2013/12/13 16:34:40, bungeman1 wrote: > > On 2013/12/13 ...
7 years ago (2013-12-13 17:33:02 UTC) #28
mtklein
On 2013/12/13 17:33:02, mtklein wrote: > On 2013/12/13 17:23:35, bungeman1 wrote: > > On 2013/12/13 ...
7 years ago (2013-12-13 19:13:13 UTC) #29
Kimmo Kinnunen
On 2013/12/13 17:23:35, bungeman1 wrote: > On 2013/12/13 16:34:40, bungeman1 wrote: > > On 2013/12/13 ...
7 years ago (2013-12-16 06:19:03 UTC) #30
Kimmo Kinnunen
On 2013/12/16 06:19:03, kkinnunen wrote: > Yes, all this is fixable for unixish builds. Still, ...
7 years ago (2013-12-16 12:37:42 UTC) #31
bungeman-skia
I believe that all of the issues which came up out of this have now ...
6 years, 11 months ago (2014-01-10 19:01:13 UTC) #32
Kimmo Kinnunen
On 2014/01/10 19:01:13, bungeman1 wrote: > I believe that all of the issues which came ...
6 years, 11 months ago (2014-01-13 16:54:01 UTC) #33
bungeman-skia
On 2014/01/13 16:54:01, kkinnunen wrote: > On 2014/01/10 19:01:13, bungeman1 wrote: > > I believe ...
6 years, 11 months ago (2014-01-13 21:22:02 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/99483003/250001
6 years, 11 months ago (2014-01-14 18:17:59 UTC) #35
commit-bot: I haz the power
Change committed as 13068
6 years, 11 months ago (2014-01-14 18:42:31 UTC) #36
djsollen
reverted with the following CL as it was breaking the Android bots. https://codereview.chromium.org/138683006
6 years, 11 months ago (2014-01-14 21:55:26 UTC) #37
Kimmo Kinnunen
On 2014/01/14 21:55:26, djsollen wrote: > reverted with the following CL as it was breaking ...
6 years, 11 months ago (2014-01-16 21:07:45 UTC) #38
djsollen
Yes, that is what I was thinking. I think we should file a bug about ...
6 years, 11 months ago (2014-01-16 21:14:13 UTC) #39
Kimmo Kinnunen
Brian, you lgtm'd this before. I wonder if it'd make sense to integrate this now? ...
6 years, 11 months ago (2014-01-17 16:45:10 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/99483003/490001
6 years, 11 months ago (2014-01-17 17:37:44 UTC) #41
commit-bot: I haz the power
6 years, 11 months ago (2014-01-17 17:55:06 UTC) #42
Message was sent while issue was closed.
Change committed as 13120

Powered by Google App Engine
This is Rietveld 408576698