Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkFibBlockSizes< kMaxSize > Class Template Reference

#include <SkArenaAlloc.h>

Public Member Functions

 SkFibBlockSizes (uint32_t staticBlockSize, uint32_t firstAllocationSize)
 
uint32_t nextBlockSize ()
 

Detailed Description

template<uint32_t kMaxSize>
class SkFibBlockSizes< kMaxSize >

Definition at line 33 of file SkArenaAlloc.h.

Constructor & Destructor Documentation

◆ SkFibBlockSizes()

template<uint32_t kMaxSize>
SkFibBlockSizes< kMaxSize >::SkFibBlockSizes ( uint32_t  staticBlockSize,
uint32_t  firstAllocationSize 
)
inline

Definition at line 40 of file SkArenaAlloc.h.

40 : fIndex{0} {
41 fBlockUnitSize = firstAllocationSize > 0 ? firstAllocationSize :
42 staticBlockSize > 0 ? staticBlockSize : 1024;
43
44 SkASSERT_RELEASE(0 < fBlockUnitSize);
45 SkASSERT_RELEASE(fBlockUnitSize < std::min(kMaxSize, (1u << 26) - 1));
46 }
#define SkASSERT_RELEASE(cond)
Definition: SkAssert.h:100
static float min(float r, float g, float b)
Definition: hsl.cpp:48

Member Function Documentation

◆ nextBlockSize()

template<uint32_t kMaxSize>
uint32_t SkFibBlockSizes< kMaxSize >::nextBlockSize ( )
inline

Definition at line 48 of file SkArenaAlloc.h.

48 {
49 uint32_t result = SkFibonacci47[fIndex] * fBlockUnitSize;
50
51 if (SkTo<size_t>(fIndex + 1) < SkFibonacci47.size() &&
52 SkFibonacci47[fIndex + 1] < kMaxSize / fBlockUnitSize)
53 {
54 fIndex += 1;
55 }
56
57 return result;
58 }
std::array< const uint32_t, 47 > SkFibonacci47
GAsyncResult * result

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