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

Unified Diff: include/core/SkTypes.h

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/private/SkTemplates.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypes.h
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 27280d42832bc1f001026f3a0dbd9ea51783e873..1051f08ceaa807840cc361eb212e47377fed1ab2 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -519,7 +519,7 @@ public:
/** Free the current buffer, and set the internal reference to NULL. Same
as calling sk_free(release())
*/
- void free() {
+ void reset() {
sk_free(fPtr);
fPtr = NULL;
}
@@ -571,7 +571,7 @@ public:
/**
* Reallocates the block to a new size. The ptr may or may not change.
*/
- void* reset(size_t size, OnShrink shrink = kAlloc_OnShrink, bool* didChangeAlloc = NULL) {
+ void* reset(size_t size = 0, OnShrink shrink = kAlloc_OnShrink, bool* didChangeAlloc = NULL) {
if (size == fSize || (kReuse_OnShrink == shrink && size < fSize)) {
if (didChangeAlloc) {
*didChangeAlloc = false;
@@ -590,13 +590,6 @@ public:
}
/**
- * Releases the block back to the heap
- */
- void free() {
- this->reset(0);
- }
-
- /**
* Return the allocated block.
*/
void* get() { return fPtr; }
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | include/private/SkTemplates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698