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

Side by Side Diff: src/core/SkLiteDL.cpp

Issue 2228953002: Purge the SkLiteDL freelist when PurgeAllCaches() is called. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: stray static Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageFilter.h" 10 #include "SkImageFilter.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 self->fBytes.rewind(); 704 self->fBytes.rewind();
705 705
706 SkAutoMutexAcquire lock(gFreeStackLock); 706 SkAutoMutexAcquire lock(gFreeStackLock);
707 self->fNext = gFreeStack; 707 self->fNext = gFreeStack;
708 gFreeStack = self; 708 gFreeStack = self;
709 return; 709 return;
710 } 710 }
711 711
712 delete this; 712 delete this;
713 } 713 }
714
715 void SkLiteDL::PurgeFreelist() {
716 SkAutoMutexAcquire lock(gFreeStackLock);
717 while (gFreeStack) {
718 SkLiteDL* top = gFreeStack;
719 gFreeStack = gFreeStack->fNext;
720 delete top; // Calling unref() here would just put it back on the list !
721 }
722 }
OLDNEW
« no previous file with comments | « src/core/SkLiteDL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698