Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkArenaAllocWithReset Class Reference

#include <SkArenaAlloc.h>

Inheritance diagram for SkArenaAllocWithReset:
SkArenaAlloc SkSTArenaAllocWithReset< 512 > SkSTArenaAllocWithReset< 1024 *1024 > SkSTArenaAllocWithReset< kInitialArenaSize > SkSTArenaAllocWithReset< 4 *sizeof(skgpu::graphite::IntersectionTree)> SkSTArenaAllocWithReset< InlineStorageSize >

Public Member Functions

 SkArenaAllocWithReset (char *block, size_t blockSize, size_t firstHeapAllocation)
 
 SkArenaAllocWithReset (size_t firstHeapAllocation)
 
void reset ()
 
bool isEmpty ()
 
- Public Member Functions inherited from SkArenaAlloc
 SkArenaAlloc (char *block, size_t blockSize, size_t firstHeapAllocation)
 
 SkArenaAlloc (size_t firstHeapAllocation)
 
 SkArenaAlloc (const SkArenaAlloc &)=delete
 
SkArenaAllocoperator= (const SkArenaAlloc &)=delete
 
 SkArenaAlloc (SkArenaAlloc &&)=delete
 
SkArenaAllocoperator= (SkArenaAlloc &&)=delete
 
 ~SkArenaAlloc ()
 
template<typename Ctor >
auto make (Ctor &&ctor) -> decltype(ctor(nullptr))
 
template<typename T , typename... Args>
Tmake (Args &&... args)
 
template<typename T >
Tmake ()
 
template<typename T >
TmakeArrayDefault (size_t count)
 
template<typename T >
TmakeArray (size_t count)
 
template<typename T , typename Initializer >
TmakeInitializedArray (size_t count, Initializer initializer)
 
void * makeBytesAlignedTo (size_t size, size_t align)
 

Additional Inherited Members

- Protected Types inherited from SkArenaAlloc
using FooterAction = char *(char *)
 
- Protected Member Functions inherited from SkArenaAlloc
char * cursor ()
 
char * end ()
 

Detailed Description

Definition at line 307 of file SkArenaAlloc.h.

Constructor & Destructor Documentation

◆ SkArenaAllocWithReset() [1/2]

SkArenaAllocWithReset::SkArenaAllocWithReset ( char *  block,
size_t  blockSize,
size_t  firstHeapAllocation 
)

Definition at line 146 of file SkArenaAlloc.cpp.

149 : SkArenaAlloc(block, size, firstHeapAllocation)
150 , fFirstBlock{block}
151 , fFirstSize{SkToU32(size)}
152 , fFirstHeapAllocationSize{SkToU32(firstHeapAllocation)} {}
constexpr uint32_t SkToU32(S x)
Definition SkTo.h:26

◆ SkArenaAllocWithReset() [2/2]

SkArenaAllocWithReset::SkArenaAllocWithReset ( size_t  firstHeapAllocation)
inlineexplicit

Definition at line 311 of file SkArenaAlloc.h.

312 : SkArenaAllocWithReset(nullptr, 0, firstHeapAllocation) {}

Member Function Documentation

◆ isEmpty()

bool SkArenaAllocWithReset::isEmpty ( )

Definition at line 162 of file SkArenaAlloc.cpp.

162 {
163 return this->cursor() == nullptr ||
164 this->cursor() == fFirstBlock + sizeof(Footer);
165}
char * cursor()

◆ reset()

void SkArenaAllocWithReset::reset ( )

Definition at line 154 of file SkArenaAlloc.cpp.

154 {
155 char* const firstBlock = fFirstBlock;
156 const uint32_t firstSize = fFirstSize;
157 const uint32_t firstHeapAllocationSize = fFirstHeapAllocationSize;
159 new (this) SkArenaAllocWithReset{firstBlock, firstSize, firstHeapAllocationSize};
160}

The documentation for this class was generated from the following files: