diff options
author | 2016-03-17 10:51:27 -0700 | |
---|---|---|
committer | 2016-03-17 10:51:27 -0700 | |
commit | 852f15da7ceb53cfb49b9f728baa6dbc53b27694 (patch) | |
tree | 31449f58fc3d72056c5661ca81c43d6055237ebe /include/core/SkTypes.h | |
parent | 9ce9d6772df650ceb0511f275e1a83dffa78ff72 (diff) |
free -> reset
The C++ standard library uses ".reset()" where we sometimes write ".free()".
We also use ".reset()" quite a lot. This standardizes on ".reset()".
This is one more step towards dropping SkAutoTDelete in favor of the standard
std::unique_ptr.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811723002
Committed: https://skia.googlesource.com/skia/+/0e3738db89e86035ed5d4f629bf58b817b1e5274
Review URL: https://codereview.chromium.org/1811723002
Diffstat (limited to 'include/core/SkTypes.h')
-rw-r--r-- | include/core/SkTypes.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 27280d4283..1051f08cea 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; } |