Flutter Engine
The Flutter Engine
|
#include <SkAutoMalloc.h>
Public Types | |
enum | OnShrink { kAlloc_OnShrink , kReuse_OnShrink } |
Public Member Functions | |
SkAutoMalloc (size_t size=0) | |
void * | reset (size_t size=0, OnShrink shrink=kAlloc_OnShrink) |
void * | get () |
const void * | get () const |
void * | release () |
Manage an allocated block of heap memory. This object is the sole manager of the lifetime of the block, so the caller must not call sk_free() or delete on the block, unless release() was called.
Definition at line 25 of file SkAutoMalloc.h.
Passed to reset to specify what happens if the requested size is smaller than the current size (and the current block was dynamically allocated).
Definition at line 34 of file SkAutoMalloc.h.
|
inlineexplicit |
Definition at line 27 of file SkAutoMalloc.h.
|
inline |
|
inline |
Definition at line 65 of file SkAutoMalloc.h.
|
inline |
Transfer ownership of the current ptr to the caller, setting the internal reference to null. Note the caller is reponsible for calling sk_free on the returned address.
Definition at line 71 of file SkAutoMalloc.h.
|
inline |
Reallocates the block to a new size. The ptr may or may not change.
Definition at line 53 of file SkAutoMalloc.h.