Coverage Report

Created: 2024-09-14 07:19

/src/skia/include/private/base/SkTemplates.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2006 The Android Open Source Project
3
 *
4
 * Use of this source code is governed by a BSD-style license that can be
5
 * found in the LICENSE file.
6
 */
7
8
#ifndef SkTemplates_DEFINED
9
#define SkTemplates_DEFINED
10
11
#include "include/private/base/SkAlign.h"
12
#include "include/private/base/SkAssert.h"
13
#include "include/private/base/SkDebug.h"
14
#include "include/private/base/SkMalloc.h"
15
#include "include/private/base/SkTLogic.h"
16
#include "include/private/base/SkTo.h"
17
18
#include <array>
19
#include <cstddef>
20
#include <cstdint>
21
#include <cstring>
22
#include <memory>
23
#include <type_traits>
24
#include <utility>
25
26
27
/** \file SkTemplates.h
28
29
    This file contains light-weight template classes for type-safe and exception-safe
30
    resource management.
31
*/
32
33
/**
34
 *  Marks a local variable as known to be unused (to avoid warnings).
35
 *  Note that this does *not* prevent the local variable from being optimized away.
36
 */
37
234k
template<typename T> inline void sk_ignore_unused_variable(const T&) { }
void sk_ignore_unused_variable<unsigned char>(unsigned char const&)
Line
Count
Source
37
234k
template<typename T> inline void sk_ignore_unused_variable(const T&) { }
Unexecuted instantiation: void sk_ignore_unused_variable<bool>(bool const&)
void sk_ignore_unused_variable<int>(int const&)
Line
Count
Source
37
10
template<typename T> inline void sk_ignore_unused_variable(const T&) { }
Unexecuted instantiation: void sk_ignore_unused_variable<float>(float const&)
38
39
/**
40
 * This is a general purpose absolute-value function.
41
 * See SkAbs32 in (SkSafe32.h) for a 32-bit int specific version that asserts.
42
 */
43
686M
template <typename T> static inline T SkTAbs(T value) {
44
686M
    if (value < 0) {
45
268M
        value = -value;
46
268M
    }
47
686M
    return value;
48
686M
}
Unexecuted instantiation: DebugCanvas.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: DrawCommand.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: RandomScalerContext.cpp:float SkTAbs<float>(float)
SkColorSpace.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
365k
template <typename T> static inline T SkTAbs(T value) {
44
365k
    if (value < 0) {
45
21.8k
        value = -value;
46
21.8k
    }
47
365k
    return value;
48
365k
}
Unexecuted instantiation: SkColorSpaceXformSteps.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkDevice.cpp:float SkTAbs<float>(float)
SkDrawBase.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
73.9k
template <typename T> static inline T SkTAbs(T value) {
44
73.9k
    if (value < 0) {
45
5.34k
        value = -value;
46
5.34k
    }
47
73.9k
    return value;
48
73.9k
}
SkGeometry.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
2.54M
template <typename T> static inline T SkTAbs(T value) {
44
2.54M
    if (value < 0) {
45
1.49M
        value = -value;
46
1.49M
    }
47
2.54M
    return value;
48
2.54M
}
Unexecuted instantiation: SkImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkImageFilterTypes.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPaint.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPaintPriv.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkRRect.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkRect.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkRuntimeEffect.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkScan_Path.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkImage.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkColorShader.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpBuilder.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpContour.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpEdgeBuilder.cpp:float SkTAbs<float>(float)
SkOpSegment.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
347M
template <typename T> static inline T SkTAbs(T value) {
44
347M
    if (value < 0) {
45
125M
        value = -value;
46
125M
    }
47
347M
    return value;
48
347M
}
SkOpSegment.cpp:int SkTAbs<int>(int)
Line
Count
Source
43
135M
template <typename T> static inline T SkTAbs(T value) {
44
135M
    if (value < 0) {
45
51.9M
        value = -value;
46
51.9M
    }
47
135M
    return value;
48
135M
}
Unexecuted instantiation: SkOpSpan.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsConic.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsCubic.cpp:float SkTAbs<float>(float)
SkPathOpsCurve.cpp:double SkTAbs<double>(double)
Line
Count
Source
43
199M
template <typename T> static inline T SkTAbs(T value) {
44
199M
    if (value < 0) {
45
89.1M
        value = -value;
46
89.1M
    }
47
199M
    return value;
48
199M
}
Unexecuted instantiation: SkPathOpsCurve.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsDebug.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsLine.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsOp.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsQuad.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsRect.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsSimplify.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsTypes.cpp:int SkTAbs<int>(int)
Unexecuted instantiation: SkPathOpsWinding.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathWriter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkReduceOrder.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPatchUtils.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkShadowUtils.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkGradientBaseShader.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkBlendModeColorFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkBlendImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkColorFilterImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkCropImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkLightingImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkMatrixConvolutionImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkShaderImageFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrColorInfo.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrColorSpaceXform.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrTestUtils.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SurfaceDrawContext.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrSkSLFP.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrGLSLShaderBuilder.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkImage_GaneshBase.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: DrawAtlasOp.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: DrawMeshOp.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: LatticeOp.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: OpsTask.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: QuadPerEdgeAA.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: TextureOp.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPDFDocument.cpp:int SkTAbs<int>(int)
Unexecuted instantiation: SkPDFMetadata.cpp:int SkTAbs<int>(int)
Unexecuted instantiation: SkIcoCodec.cpp:float SkTAbs<float>(float)
SkFontHost_FreeType_common.cpp:int SkTAbs<int>(int)
Line
Count
Source
43
118
template <typename T> static inline T SkTAbs(T value) {
44
118
    if (value < 0) {
45
0
        value = -value;
46
0
    }
47
118
    return value;
48
118
}
Unexecuted instantiation: DataUtils.cpp:int SkTAbs<int>(int)
Unexecuted instantiation: SkClipStack.cpp:float SkTAbs<float>(float)
SkDraw.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
18.3k
template <typename T> static inline T SkTAbs(T value) {
44
18.3k
    if (value < 0) {
45
2.45k
        value = -value;
46
2.45k
    }
47
18.3k
    return value;
48
18.3k
}
Unexecuted instantiation: SkDraw_atlas.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkRasterPipelineBlitter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkImage_Base.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkAddIntersections.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkDConicLineIntersection.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkDCubicLineIntersection.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkDLineIntersection.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkDQuadLineIntersection.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkIntersections.cpp:float SkTAbs<float>(float)
SkOpAngle.cpp:int SkTAbs<int>(int)
Line
Count
Source
43
1.21M
template <typename T> static inline T SkTAbs(T value) {
44
1.21M
    if (value < 0) {
45
107k
        value = -value;
46
107k
    }
47
1.21M
    return value;
48
1.21M
}
Unexecuted instantiation: SkOpAngle.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpCoincidence.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpCubicHull.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsAsWinding.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsCommon.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPathOpsTSect.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkShadowTessellator.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkRuntimeImageFilter.cpp:float SkTAbs<float>(float)
GrDistanceFieldGenFromVector.cpp:double SkTAbs<double>(double)
Line
Count
Source
43
30
template <typename T> static inline T SkTAbs(T value) {
44
30
    if (value < 0) {
45
0
        value = -value;
46
0
    }
47
30
    return value;
48
30
}
Unexecuted instantiation: GrDistanceFieldGenFromVector.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrFragmentProcessors.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrBitmapTextGeoProc.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: GrGradientShader.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: Device.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: PaintParams.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: ShaderCodeDictionary.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkPDFDevice.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkBlitter_Sprite.cpp:float SkTAbs<float>(float)
SkPolyUtils.cpp:float SkTAbs<float>(float)
Line
Count
Source
43
1.62k
template <typename T> static inline T SkTAbs(T value) {
44
1.62k
    if (value < 0) {
45
0
        value = -value;
46
0
    }
47
1.62k
    return value;
48
1.62k
}
Unexecuted instantiation: ClipStack.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: ClipStack_graphite.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: KeyHelpers.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: PrecompileColorFilter.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: PrecompileShader.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkSGNode.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkSGPath.cpp:float SkTAbs<float>(float)
Unexecuted instantiation: SkOpSpan.cpp:int SkTAbs<int>(int)
Unexecuted instantiation: SkPathOpsTightBounds.cpp:float SkTAbs<float>(float)
49
50
/**
51
 *  Returns a pointer to a D which comes immediately after S[count].
52
 */
53
template <typename D, typename S> inline D* SkTAfter(S* ptr, size_t count = 1) {
54
    return reinterpret_cast<D*>(ptr + count);
55
}
56
57
/**
58
 *  Returns a pointer to a D which comes byteOffset bytes after S.
59
 */
60
364M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
364M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
364M
}
Unexecuted instantiation: float* SkTAddOffset<float, void>(void*, long)
unsigned char const* SkTAddOffset<unsigned char const, unsigned char const>(unsigned char const*, long)
Line
Count
Source
60
9.24M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
9.24M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
9.24M
}
unsigned int const* SkTAddOffset<unsigned int const, unsigned int const>(unsigned int const*, long)
Line
Count
Source
60
72
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
72
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
72
}
Unexecuted instantiation: unsigned short const* SkTAddOffset<unsigned short const, unsigned short const>(unsigned short const*, long)
void* SkTAddOffset<void, void>(void*, long)
Line
Count
Source
60
245M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
245M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
245M
}
void const* SkTAddOffset<void const, void const>(void const*, long)
Line
Count
Source
60
9.16M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
9.16M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
9.16M
}
unsigned char* SkTAddOffset<unsigned char, unsigned char>(unsigned char*, long)
Line
Count
Source
60
26.1M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
26.1M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
26.1M
}
Unexecuted instantiation: unsigned long const* SkTAddOffset<unsigned long const, unsigned long const>(unsigned long const*, long)
float const* SkTAddOffset<float const, float const>(float const*, long)
Line
Count
Source
60
13.0k
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
13.0k
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
13.0k
}
unsigned int* SkTAddOffset<unsigned int, unsigned int>(unsigned int*, long)
Line
Count
Source
60
24.9M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
24.9M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
24.9M
}
Unexecuted instantiation: unsigned short* SkTAddOffset<unsigned short, unsigned short>(unsigned short*, long)
Unexecuted instantiation: unsigned long* SkTAddOffset<unsigned long, unsigned long>(unsigned long*, long)
unsigned int* SkTAddOffset<unsigned int, void>(void*, long)
Line
Count
Source
60
424k
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
424k
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
424k
}
Unexecuted instantiation: unsigned short* SkTAddOffset<unsigned short, void>(void*, long)
Unexecuted instantiation: float const* SkTAddOffset<float const, void const>(void const*, long)
Unexecuted instantiation: int const* SkTAddOffset<int const, void const>(void const*, long)
Unexecuted instantiation: char const* SkTAddOffset<char const, void const>(void const*, long)
Unexecuted instantiation: unsigned short const* SkTAddOffset<unsigned short const, void const>(void const*, long)
Unexecuted instantiation: void* SkTAddOffset<void, char>(char*, long)
unsigned long const* SkTAddOffset<unsigned long const, void const>(void const*, long)
Line
Count
Source
60
526
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
526
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
526
}
unsigned int const* SkTAddOffset<unsigned int const, void const>(void const*, long)
Line
Count
Source
60
1.74k
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
1.74k
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
1.74k
}
unsigned int* SkTAddOffset<unsigned int, unsigned char>(unsigned char*, long)
Line
Count
Source
60
49
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
49
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
49
}
char* SkTAddOffset<char, void>(void*, long)
Line
Count
Source
60
1.65k
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
1.65k
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
1.65k
}
void* SkTAddOffset<void, SkDescriptor>(SkDescriptor*, long)
Line
Count
Source
60
304
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
304
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
304
}
void* SkTAddOffset<void, std::byte>(std::byte*, long)
Line
Count
Source
60
47.8M
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
47.8M
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
47.8M
}
void const* SkTAddOffset<void const, unsigned char>(unsigned char*, long)
Line
Count
Source
60
778k
template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) {
61
    // The intermediate char* has the same cv-ness as D as this produces better error messages.
62
    // This relies on the fact that reinterpret_cast can add constness, but cannot remove it.
63
778k
    return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset);
64
778k
}
Unexecuted instantiation: int* SkTAddOffset<int, int>(int*, long)
65
66
template <typename T, T* P> struct SkOverloadedFunctionObject {
67
    template <typename... Args>
68
1.03M
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
1.03M
        return P(std::forward<Args>(args)...);
70
1.03M
    }
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPjEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPhEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
33.2k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
33.2k
        return P(std::forward<Args>(args)...);
70
33.2k
    }
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRP7SkPointEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS7_
Line
Count
Source
68
10.1k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
10.1k
        return P(std::forward<Args>(args)...);
70
10.1k
    }
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN15SkFontArguments7Palette8OverrideEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS9_
Line
Count
Source
68
19.8k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
19.8k
        return P(std::forward<Args>(args)...);
70
19.8k
    }
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_ZN13SkMaskBuilder9FreeImageES0_EEEclIJRPhEEEDTcladL_ZNS2_9FreeImageES0_Espclsr3stdE7forwardIT_Efp_EEEDpOS7_
Line
Count
Source
68
104k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
104k
        return P(std::forward<Args>(args)...);
70
104k
    }
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN15SkBBoxHierarchy8MetadataEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS8_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPPK9SkPictureEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS9_
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN8SkRecord6RecordEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS8_
Line
Count
Source
68
86.9k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
86.9k
        return P(std::forward<Args>(args)...);
70
86.9k
    }
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPiEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
588k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
588k
        return P(std::forward<Args>(args)...);
70
588k
    }
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPcEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
1.95k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
1.95k
        return P(std::forward<Args>(args)...);
70
1.95k
    }
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_blob_tEXadL_Z15hb_blob_destroyEEEclIJRS1_EEEDTcladL_Z15hb_blob_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_face_tEXadL_Z15hb_face_destroyEEEclIJRS1_EEEDTcladL_Z15hb_face_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP17hb_subset_input_tEXadL_Z23hb_subset_input_destroyEEEclIJRS1_EEEDTcladL_Z23hb_subset_input_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRS0_EEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS5_
Line
Count
Source
68
13.1k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
13.1k
        return P(std::forward<Args>(args)...);
70
13.1k
    }
_ZNK26SkOverloadedFunctionObjectIFvP17WebPChunkIteratorEXadL_Z29WebPDemuxReleaseChunkIteratorEEEclIJRS1_EEEDTcladL_Z29WebPDemuxReleaseChunkIteratorEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
24.8k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
24.8k
        return P(std::forward<Args>(args)...);
70
24.8k
    }
_ZNK26SkOverloadedFunctionObjectIFvP12WebPIteratorEXadL_Z24WebPDemuxReleaseIteratorEEEclIJRS1_EEEDTcladL_Z24WebPDemuxReleaseIteratorEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
27.4k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
27.4k
        return P(std::forward<Args>(args)...);
70
27.4k
    }
_ZNK26SkOverloadedFunctionObjectIFvP11WebPDemuxerEXadL_Z15WebPDemuxDeleteEEEclIJRS1_EEEDTcladL_Z15WebPDemuxDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
13.8k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
13.8k
        return P(std::forward<Args>(args)...);
70
13.8k
    }
_ZNK26SkOverloadedFunctionObjectIFvP12WebPIDecoderEXadL_Z11WebPIDeleteEEEclIJRS1_EEEDTcladL_Z11WebPIDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
14.4k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
14.4k
        return P(std::forward<Args>(args)...);
70
14.4k
    }
_ZNK26SkOverloadedFunctionObjectIFvP13WebPDecBufferEXadL_Z17WebPFreeDecBufferEEEclIJRS1_EEEDTcladL_Z17WebPFreeDecBufferEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
14.4k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
14.4k
        return P(std::forward<Args>(args)...);
70
14.4k
    }
_ZNK26SkOverloadedFunctionObjectIFiP11FT_FaceRec_EXadL_Z12FT_Done_FaceEEEclIJRS1_EEEDTcladL_Z12FT_Done_FaceEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
44.4k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
44.4k
        return P(std::forward<Args>(args)...);
70
44.4k
    }
_ZNK26SkOverloadedFunctionObjectIFiP11FT_SizeRec_EXadL_Z12FT_Done_SizeEEEclIJRS1_EEEDTcladL_Z12FT_Done_SizeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
28.1k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
28.1k
        return P(std::forward<Args>(args)...);
70
28.1k
    }
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPfEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN5skgpu8graphite14MonotonicValueINS5_31CompressedPaintersOrderSequenceEEEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOSB_
_ZNK26SkOverloadedFunctionObjectIFvP16XML_ParserStructEXadL_Z14XML_ParserFreeEEEclIJRS1_EEEDTcladL_Z14XML_ParserFreeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
2.07k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
2.07k
        return P(std::forward<Args>(args)...);
70
2.07k
    }
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_font_tEXadL_Z15hb_font_destroyEEEclIJRS1_EEEDTcladL_Z15hb_font_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP11hb_buffer_tEXadL_Z17hb_buffer_destroyEEEclIJRS1_EEEDTcladL_Z17hb_buffer_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP11hb_buffer_tEXadL_Z24hb_buffer_clear_contentsEEEclIJRS1_EEEDTcladL_Z24hb_buffer_clear_contentsEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: SkUnicode_icu.cpp:_ZNK26SkOverloadedFunctionObjectIFP5UTextS1_EXadL_ZL19utext_close_wrapperS1_EEEclIJRS1_EEEDTcladL_ZL19utext_close_wrapperS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: SkUnicode_icu.cpp:_ZNK26SkOverloadedFunctionObjectIFvP14UBreakIteratorEXadL_ZL18ubrk_close_wrapperS1_EEEclIJRS1_EEEDTcladL_ZL18ubrk_close_wrapperS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: SkWebpEncoderImpl.cpp:_ZNK26SkOverloadedFunctionObjectIFvP8WebPDataEXadL_ZL13WebPDataClearS1_EEEclIJRS1_EEEDTcladL_ZL13WebPDataClearS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP7WebPMuxEXadL_Z13WebPMuxDeleteEEEclIJRS1_EEEDTcladL_Z13WebPMuxDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
_ZNK26SkOverloadedFunctionObjectIFvP11WebPPictureEXadL_Z15WebPPictureFreeEEEclIJRS1_EEEDTcladL_Z15WebPPictureFreeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_
Line
Count
Source
68
4.33k
    auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) {
69
4.33k
        return P(std::forward<Args>(args)...);
70
4.33k
    }
71
};
72
73
template <auto F> using SkFunctionObject =
74
    SkOverloadedFunctionObject<std::remove_pointer_t<decltype(F)>, F>;
75
76
/** \class SkAutoTCallVProc
77
78
    Call a function when this goes out of scope. The template uses two
79
    parameters, the object, and a function that is to be called in the destructor.
80
    If release() is called, the object reference is set to null. If the object
81
    reference is null when the destructor is called, we do not call the
82
    function.
83
*/
84
template <typename T, void (*P)(T*)> class SkAutoTCallVProc
85
    : public std::unique_ptr<T, SkFunctionObject<P>> {
86
    using inherited = std::unique_ptr<T, SkFunctionObject<P>>;
87
public:
88
    using inherited::inherited;
89
    SkAutoTCallVProc(const SkAutoTCallVProc&) = delete;
90
    SkAutoTCallVProc(SkAutoTCallVProc&& that) : inherited(std::move(that)) {}
91
92
114k
    operator T*() const { return this->get(); }
SkAutoTCallVProc<WebPDemuxer, &WebPDemuxDelete>::operator WebPDemuxer*() const
Line
Count
Source
92
82.4k
    operator T*() const { return this->get(); }
SkAutoTCallVProc<WebPIDecoder, &WebPIDelete>::operator WebPIDecoder*() const
Line
Count
Source
92
19.3k
    operator T*() const { return this->get(); }
SkAutoTCallVProc<XML_ParserStruct, &XML_ParserFree>::operator XML_ParserStruct*() const
Line
Count
Source
92
12.4k
    operator T*() const { return this->get(); }
Unexecuted instantiation: SkAutoTCallVProc<WebPMux, &WebPMuxDelete>::operator WebPMux*() const
93
};
94
95
96
namespace skia_private {
97
/** Allocate an array of T elements, and free the array in the destructor
98
 */
99
template <typename T> class AutoTArray  {
100
public:
101
1.59k
    AutoTArray() {}
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::AutoTArray()
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::AutoTArray()
skia_private::AutoTArray<unsigned short>::AutoTArray()
Line
Count
Source
101
1.59k
    AutoTArray() {}
Unexecuted instantiation: skia_private::AutoTArray<float>::AutoTArray()
102
    // Allocate size number of T elements
103
81.9k
    explicit AutoTArray(size_t size) {
104
81.9k
        fSize = check_size_bytes_too_big<T>(size);
105
81.9k
        fData.reset(size > 0 ? new T[size] : nullptr);
106
81.9k
    }
Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::AutoTArray(unsigned long)
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::AutoTArray(unsigned long)
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(unsigned long)
Line
Count
Source
103
469
    explicit AutoTArray(size_t size) {
104
469
        fSize = check_size_bytes_too_big<T>(size);
105
469
        fData.reset(size > 0 ? new T[size] : nullptr);
106
469
    }
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::AutoTArray(unsigned long)
skia_private::AutoTArray<int>::AutoTArray(unsigned long)
Line
Count
Source
103
1.49k
    explicit AutoTArray(size_t size) {
104
1.49k
        fSize = check_size_bytes_too_big<T>(size);
105
1.49k
        fData.reset(size > 0 ? new T[size] : nullptr);
106
1.49k
    }
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::AutoTArray(unsigned long)
skia_private::AutoTArray<sk_sp<SkImageFilter> >::AutoTArray(unsigned long)
Line
Count
Source
103
78.3k
    explicit AutoTArray(size_t size) {
104
78.3k
        fSize = check_size_bytes_too_big<T>(size);
105
78.3k
        fData.reset(size > 0 ? new T[size] : nullptr);
106
78.3k
    }
skia_private::AutoTArray<unsigned short>::AutoTArray(unsigned long)
Line
Count
Source
103
1.59k
    explicit AutoTArray(size_t size) {
104
1.59k
        fSize = check_size_bytes_too_big<T>(size);
105
1.59k
        fData.reset(size > 0 ? new T[size] : nullptr);
106
1.59k
    }
skia_private::AutoTArray<float>::AutoTArray(unsigned long)
Line
Count
Source
103
2
    explicit AutoTArray(size_t size) {
104
2
        fSize = check_size_bytes_too_big<T>(size);
105
2
        fData.reset(size > 0 ? new T[size] : nullptr);
106
2
    }
Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::AutoTArray(unsigned long)
skia_private::AutoTArray<unsigned char>::AutoTArray(unsigned long)
Line
Count
Source
103
2
    explicit AutoTArray(size_t size) {
104
2
        fSize = check_size_bytes_too_big<T>(size);
105
2
        fData.reset(size > 0 ? new T[size] : nullptr);
106
2
    }
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::AutoTArray(unsigned long)
Unexecuted instantiation: skia_private::AutoTArray<char>::AutoTArray(unsigned long)
skia_private::AutoTArray<PromiseImageInfo>::AutoTArray(unsigned long)
Line
Count
Source
103
28
    explicit AutoTArray(size_t size) {
104
28
        fSize = check_size_bytes_too_big<T>(size);
105
28
        fData.reset(size > 0 ? new T[size] : nullptr);
106
28
    }
107
108
    // TODO: remove when all uses are gone.
109
501
    explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {}
Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::AutoTArray(int)
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(int)
Line
Count
Source
109
469
    explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {}
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::AutoTArray(int)
Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::AutoTArray(int)
Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::AutoTArray(int)
skia_private::AutoTArray<unsigned char>::AutoTArray(int)
Line
Count
Source
109
2
    explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {}
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::AutoTArray(int)
skia_private::AutoTArray<float>::AutoTArray(int)
Line
Count
Source
109
2
    explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {}
Unexecuted instantiation: skia_private::AutoTArray<char>::AutoTArray(int)
skia_private::AutoTArray<PromiseImageInfo>::AutoTArray(int)
Line
Count
Source
109
28
    explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {}
110
111
78.3k
    AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) {
112
78.3k
        fSize = std::exchange(other.fSize, 0);
113
78.3k
    }
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(skia_private::AutoTArray<SkCanvas::ImageSetEntry>&&)
Line
Count
Source
111
72
    AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) {
112
72
        fSize = std::exchange(other.fSize, 0);
113
72
    }
skia_private::AutoTArray<sk_sp<SkImageFilter> >::AutoTArray(skia_private::AutoTArray<sk_sp<SkImageFilter> >&&)
Line
Count
Source
111
78.3k
    AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) {
112
78.3k
        fSize = std::exchange(other.fSize, 0);
113
78.3k
    }
114
1.59k
    AutoTArray& operator=(AutoTArray&& other) {
115
1.59k
        if (this != &other) {
116
1.59k
            fData = std::move(other.fData);
117
1.59k
            fSize = std::exchange(other.fSize, 0);
118
1.59k
        }
119
1.59k
        return *this;
120
1.59k
    }
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::operator=(skia_private::AutoTArray<SkPoint>&&)
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::operator=(skia_private::AutoTArray<SkMatrix>&&)
skia_private::AutoTArray<unsigned short>::operator=(skia_private::AutoTArray<unsigned short>&&)
Line
Count
Source
114
1.59k
    AutoTArray& operator=(AutoTArray&& other) {
115
1.59k
        if (this != &other) {
116
1.59k
            fData = std::move(other.fData);
117
1.59k
            fSize = std::exchange(other.fSize, 0);
118
1.59k
        }
119
1.59k
        return *this;
120
1.59k
    }
Unexecuted instantiation: skia_private::AutoTArray<float>::operator=(skia_private::AutoTArray<float>&&)
Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::operator=(skia_private::AutoTArray<PromiseImageInfo>&&)
121
122
    // Reallocates given a new count. Reallocation occurs even if new count equals old count.
123
1.59k
    void reset(size_t count = 0) {
124
1.59k
        *this = AutoTArray(count);
125
1.59k
    }
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::reset(unsigned long)
skia_private::AutoTArray<unsigned short>::reset(unsigned long)
Line
Count
Source
123
1.59k
    void reset(size_t count = 0) {
124
1.59k
        *this = AutoTArray(count);
125
1.59k
    }
Unexecuted instantiation: skia_private::AutoTArray<float>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::reset(unsigned long)
126
127
4.79k
    T* get() const { return fData.get(); }
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::get() const
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::get() const
Line
Count
Source
127
81
    T* get() const { return fData.get(); }
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::get() const
skia_private::AutoTArray<int>::get() const
Line
Count
Source
127
1.49k
    T* get() const { return fData.get(); }
skia_private::AutoTArray<unsigned short>::get() const
Line
Count
Source
127
3.19k
    T* get() const { return fData.get(); }
skia_private::AutoTArray<float>::get() const
Line
Count
Source
127
2
    T* get() const { return fData.get(); }
Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::get() const
skia_private::AutoTArray<unsigned char>::get() const
Line
Count
Source
127
18
    T* get() const { return fData.get(); }
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::get() const
128
129
16.6k
    T&  operator[](size_t index) const {
130
16.6k
        return fData[sk_collection_check_bounds(index, fSize)];
131
16.6k
    }
Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::operator[](unsigned long) const
Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::operator[](unsigned long) const
skia_private::AutoTArray<int>::operator[](unsigned long) const
Line
Count
Source
129
12.5k
    T&  operator[](size_t index) const {
130
12.5k
        return fData[sk_collection_check_bounds(index, fSize)];
131
12.5k
    }
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::operator[](unsigned long) const
Line
Count
Source
129
2.53k
    T&  operator[](size_t index) const {
130
2.53k
        return fData[sk_collection_check_bounds(index, fSize)];
131
2.53k
    }
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::operator[](unsigned long) const
skia_private::AutoTArray<sk_sp<SkImageFilter> >::operator[](unsigned long) const
Line
Count
Source
129
25
    T&  operator[](size_t index) const {
130
25
        return fData[sk_collection_check_bounds(index, fSize)];
131
25
    }
Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::operator[](unsigned long) const
Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::operator[](unsigned long) const
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::operator[](unsigned long) const
skia_private::AutoTArray<float>::operator[](unsigned long) const
Line
Count
Source
129
1.53k
    T&  operator[](size_t index) const {
130
1.53k
        return fData[sk_collection_check_bounds(index, fSize)];
131
1.53k
    }
Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::operator[](unsigned long) const
132
133
11.9k
    const T* data() const { return fData.get(); }
134
0
    T* data() { return fData.get(); }
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::data()
Unexecuted instantiation: skia_private::AutoTArray<char>::data()
Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::data()
135
136
11.9k
    size_t size() const { return fSize; }
137
14.4k
    bool empty() const { return fSize == 0; }
138
    size_t size_bytes() const { return sizeof(T) * fSize; }
139
140
    T* begin() {
141
        return fData;
142
    }
143
    const T* begin() const {
144
        return fData;
145
    }
146
147
    // It's safe to use fItemArray + fSize because if fItemArray is nullptr then adding 0 is
148
    // valid and returns nullptr. See [expr.add] in the C++ standard.
149
    T* end() {
150
        if (fData == nullptr) {
151
            SkASSERT(fSize == 0);
152
        }
153
        return fData + fSize;
154
    }
155
    const T* end() const {
156
        if (fData == nullptr) {
157
            SkASSERT(fSize == 0);
158
        }
159
        return fData + fSize;
160
    }
161
162
private:
163
    std::unique_ptr<T[]> fData;
164
    size_t fSize = 0;
165
};
166
167
/** Wraps AutoTArray, with room for kCountRequested elements preallocated.
168
 */
169
template <int kCountRequested, typename T> class AutoSTArray {
170
public:
171
    AutoSTArray(AutoSTArray&&) = delete;
172
    AutoSTArray(const AutoSTArray&) = delete;
173
    AutoSTArray& operator=(AutoSTArray&&) = delete;
174
    AutoSTArray& operator=(const AutoSTArray&) = delete;
175
176
    /** Initialize with no objects */
177
1.81M
    AutoSTArray() {
178
1.81M
        fArray = nullptr;
179
1.81M
        fCount = 0;
180
1.81M
    }
skia_private::AutoSTArray<32, unsigned short>::AutoSTArray()
Line
Count
Source
177
12.9k
    AutoSTArray() {
178
12.9k
        fArray = nullptr;
179
12.9k
        fCount = 0;
180
12.9k
    }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::AutoSTArray()
Line
Count
Source
177
550k
    AutoSTArray() {
178
550k
        fArray = nullptr;
179
550k
        fCount = 0;
180
550k
    }
skia_private::AutoSTArray<20, SkGlyph const*>::AutoSTArray()
Line
Count
Source
177
54.4k
    AutoSTArray() {
178
54.4k
        fArray = nullptr;
179
54.4k
        fCount = 0;
180
54.4k
    }
skia_private::AutoSTArray<64, SkGlyph const*>::AutoSTArray()
Line
Count
Source
177
1.14k
    AutoSTArray() {
178
1.14k
        fArray = nullptr;
179
1.14k
        fCount = 0;
180
1.14k
    }
skia_private::AutoSTArray<4, float>::AutoSTArray()
Line
Count
Source
177
445k
    AutoSTArray() {
178
445k
        fArray = nullptr;
179
445k
        fCount = 0;
180
445k
    }
skia_private::AutoSTArray<8, unsigned int>::AutoSTArray()
Line
Count
Source
177
295k
    AutoSTArray() {
178
295k
        fArray = nullptr;
179
295k
        fCount = 0;
180
295k
    }
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::AutoSTArray()
skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::AutoSTArray()
Line
Count
Source
177
235k
    AutoSTArray() {
178
235k
        fArray = nullptr;
179
235k
        fCount = 0;
180
235k
    }
skia_private::AutoSTArray<14, GrMipLevel>::AutoSTArray()
Line
Count
Source
177
107k
    AutoSTArray() {
178
107k
        fArray = nullptr;
179
107k
        fCount = 0;
180
107k
    }
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::AutoSTArray()
Line
Count
Source
177
107k
    AutoSTArray() {
178
107k
        fArray = nullptr;
179
107k
        fCount = 0;
180
107k
    }
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::AutoSTArray()
skia_private::AutoSTArray<24, unsigned int>::AutoSTArray()
Line
Count
Source
177
6.47k
    AutoSTArray() {
178
6.47k
        fArray = nullptr;
179
6.47k
        fCount = 0;
180
6.47k
    }
skia_private::AutoSTArray<64, SkRect>::AutoSTArray()
Line
Count
Source
177
1
    AutoSTArray() {
178
1
        fArray = nullptr;
179
1
        fCount = 0;
180
1
    }
Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::AutoSTArray()
181
182
    /** Allocate count number of T elements
183
     */
184
5.99k
    AutoSTArray(int count) {
185
5.99k
        fArray = nullptr;
186
5.99k
        fCount = 0;
187
5.99k
        this->reset(count);
188
5.99k
    }
skia_private::AutoSTArray<16, SkRect>::AutoSTArray(int)
Line
Count
Source
184
2.89k
    AutoSTArray(int count) {
185
2.89k
        fArray = nullptr;
186
2.89k
        fCount = 0;
187
2.89k
        this->reset(count);
188
2.89k
    }
skia_private::AutoSTArray<32, float>::AutoSTArray(int)
Line
Count
Source
184
766
    AutoSTArray(int count) {
185
766
        fArray = nullptr;
186
766
        fCount = 0;
187
766
        this->reset(count);
188
766
    }
skia_private::AutoSTArray<16, float>::AutoSTArray(int)
Line
Count
Source
184
101
    AutoSTArray(int count) {
185
101
        fArray = nullptr;
186
101
        fCount = 0;
187
101
        this->reset(count);
188
101
    }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::AutoSTArray(int)
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<16, unsigned int>::AutoSTArray(int)
skia_private::AutoSTArray<64, int>::AutoSTArray(int)
Line
Count
Source
184
1.49k
    AutoSTArray(int count) {
185
1.49k
        fArray = nullptr;
186
1.49k
        fCount = 0;
187
1.49k
        this->reset(count);
188
1.49k
    }
skia_private::AutoSTArray<64, TriangulationVertex>::AutoSTArray(int)
Line
Count
Source
184
748
    AutoSTArray(int count) {
185
748
        fArray = nullptr;
186
748
        fCount = 0;
187
748
        this->reset(count);
188
748
    }
Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::AutoSTArray(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::AutoSTArray(int)
189
190
1.82M
    ~AutoSTArray() {
191
1.82M
        this->reset(0);
192
1.82M
    }
skia_private::AutoSTArray<32, unsigned short>::~AutoSTArray()
Line
Count
Source
190
12.9k
    ~AutoSTArray() {
191
12.9k
        this->reset(0);
192
12.9k
    }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::~AutoSTArray()
Line
Count
Source
190
550k
    ~AutoSTArray() {
191
550k
        this->reset(0);
192
550k
    }
skia_private::AutoSTArray<20, SkGlyph const*>::~AutoSTArray()
Line
Count
Source
190
54.4k
    ~AutoSTArray() {
191
54.4k
        this->reset(0);
192
54.4k
    }
skia_private::AutoSTArray<64, SkGlyph const*>::~AutoSTArray()
Line
Count
Source
190
1.14k
    ~AutoSTArray() {
191
1.14k
        this->reset(0);
192
1.14k
    }
skia_private::AutoSTArray<16, SkRect>::~AutoSTArray()
Line
Count
Source
190
2.89k
    ~AutoSTArray() {
191
2.89k
        this->reset(0);
192
2.89k
    }
skia_private::AutoSTArray<4, float>::~AutoSTArray()
Line
Count
Source
190
445k
    ~AutoSTArray() {
191
445k
        this->reset(0);
192
445k
    }
skia_private::AutoSTArray<8, unsigned int>::~AutoSTArray()
Line
Count
Source
190
295k
    ~AutoSTArray() {
191
295k
        this->reset(0);
192
295k
    }
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::~AutoSTArray()
skia_private::AutoSTArray<32, float>::~AutoSTArray()
Line
Count
Source
190
766
    ~AutoSTArray() {
191
766
        this->reset(0);
192
766
    }
skia_private::AutoSTArray<16, float>::~AutoSTArray()
Line
Count
Source
190
101
    ~AutoSTArray() {
191
101
        this->reset(0);
192
101
    }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::~AutoSTArray()
skia_private::AutoSTArray<14, GrMipLevel>::~AutoSTArray()
Line
Count
Source
190
107k
    ~AutoSTArray() {
191
107k
        this->reset(0);
192
107k
    }
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::~AutoSTArray()
Line
Count
Source
190
107k
    ~AutoSTArray() {
191
107k
        this->reset(0);
192
107k
    }
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::~AutoSTArray()
skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::~AutoSTArray()
Line
Count
Source
190
235k
    ~AutoSTArray() {
191
235k
        this->reset(0);
192
235k
    }
skia_private::AutoSTArray<24, unsigned int>::~AutoSTArray()
Line
Count
Source
190
6.47k
    ~AutoSTArray() {
191
6.47k
        this->reset(0);
192
6.47k
    }
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<16, unsigned int>::~AutoSTArray()
skia_private::AutoSTArray<64, int>::~AutoSTArray()
Line
Count
Source
190
1.49k
    ~AutoSTArray() {
191
1.49k
        this->reset(0);
192
1.49k
    }
skia_private::AutoSTArray<64, TriangulationVertex>::~AutoSTArray()
Line
Count
Source
190
748
    ~AutoSTArray() {
191
748
        this->reset(0);
192
748
    }
skia_private::AutoSTArray<64, SkRect>::~AutoSTArray()
Line
Count
Source
190
1
    ~AutoSTArray() {
191
1
        this->reset(0);
192
1
    }
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::~AutoSTArray()
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::~AutoSTArray()
193
194
    /** Destroys previous objects in the array and default constructs count number of objects */
195
3.38M
    void reset(int count) {
196
3.38M
        T* start = fArray;
197
3.38M
        T* iter = start + fCount;
198
5.61M
        while (iter > start) {
199
2.22M
            (--iter)->~T();
200
2.22M
        }
201
202
3.38M
        SkASSERT(count >= 0);
203
3.38M
        if (fCount != count) {
204
1.97M
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
99.0k
                SkASSERT((T*) fStorage != fArray);
207
99.0k
                sk_free(fArray);
208
99.0k
            }
209
210
1.97M
            if (count > kCount) {
211
99.0k
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
1.87M
            } else if (count > 0) {
213
887k
                fArray = (T*) fStorage;
214
986k
            } else {
215
986k
                fArray = nullptr;
216
986k
            }
217
218
1.97M
            fCount = count;
219
1.97M
        }
220
221
3.38M
        iter = fArray;
222
3.38M
        T* stop = fArray + count;
223
5.61M
        while (iter < stop) {
224
2.22M
            new (iter++) T;
225
2.22M
        }
226
3.38M
    }
skia_private::AutoSTArray<32, unsigned short>::reset(int)
Line
Count
Source
195
13.3k
    void reset(int count) {
196
13.3k
        T* start = fArray;
197
13.3k
        T* iter = start + fCount;
198
32.9k
        while (iter > start) {
199
19.5k
            (--iter)->~T();
200
19.5k
        }
201
202
13.3k
        SkASSERT(count >= 0);
203
13.3k
        if (fCount != count) {
204
732
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
151
                SkASSERT((T*) fStorage != fArray);
207
151
                sk_free(fArray);
208
151
            }
209
210
732
            if (count > kCount) {
211
151
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
581
            } else if (count > 0) {
213
215
                fArray = (T*) fStorage;
214
366
            } else {
215
366
                fArray = nullptr;
216
366
            }
217
218
732
            fCount = count;
219
732
        }
220
221
13.3k
        iter = fArray;
222
13.3k
        T* stop = fArray + count;
223
32.9k
        while (iter < stop) {
224
19.5k
            new (iter++) T;
225
19.5k
        }
226
13.3k
    }
skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::reset(int)
Line
Count
Source
195
471k
    void reset(int count) {
196
471k
        T* start = fArray;
197
471k
        T* iter = start + fCount;
198
684k
        while (iter > start) {
199
212k
            (--iter)->~T();
200
212k
        }
201
202
471k
        SkASSERT(count >= 0);
203
471k
        if (fCount != count) {
204
393k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
0
                SkASSERT((T*) fStorage != fArray);
207
0
                sk_free(fArray);
208
0
            }
209
210
393k
            if (count > kCount) {
211
0
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
393k
            } else if (count > 0) {
213
196k
                fArray = (T*) fStorage;
214
196k
            } else {
215
196k
                fArray = nullptr;
216
196k
            }
217
218
393k
            fCount = count;
219
393k
        }
220
221
471k
        iter = fArray;
222
471k
        T* stop = fArray + count;
223
684k
        while (iter < stop) {
224
212k
            new (iter++) T;
225
212k
        }
226
471k
    }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::reset(int)
Line
Count
Source
195
1.07M
    void reset(int count) {
196
1.07M
        T* start = fArray;
197
1.07M
        T* iter = start + fCount;
198
1.95M
        while (iter > start) {
199
886k
            (--iter)->~T();
200
886k
        }
201
202
1.07M
        SkASSERT(count >= 0);
203
1.07M
        if (fCount != count) {
204
991k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
74.2k
                SkASSERT((T*) fStorage != fArray);
207
74.2k
                sk_free(fArray);
208
74.2k
            }
209
210
991k
            if (count > kCount) {
211
74.2k
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
916k
            } else if (count > 0) {
213
421k
                fArray = (T*) fStorage;
214
495k
            } else {
215
495k
                fArray = nullptr;
216
495k
            }
217
218
991k
            fCount = count;
219
991k
        }
220
221
1.07M
        iter = fArray;
222
1.07M
        T* stop = fArray + count;
223
1.95M
        while (iter < stop) {
224
886k
            new (iter++) T;
225
886k
        }
226
1.07M
    }
skia_private::AutoSTArray<20, SkGlyph const*>::reset(int)
Line
Count
Source
195
108k
    void reset(int count) {
196
108k
        T* start = fArray;
197
108k
        T* iter = start + fCount;
198
656k
        while (iter > start) {
199
547k
            (--iter)->~T();
200
547k
        }
201
202
108k
        SkASSERT(count >= 0);
203
108k
        if (fCount != count) {
204
108k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
14.9k
                SkASSERT((T*) fStorage != fArray);
207
14.9k
                sk_free(fArray);
208
14.9k
            }
209
210
108k
            if (count > kCount) {
211
14.9k
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
94.0k
            } else if (count > 0) {
213
39.5k
                fArray = (T*) fStorage;
214
54.4k
            } else {
215
54.4k
                fArray = nullptr;
216
54.4k
            }
217
218
108k
            fCount = count;
219
108k
        }
220
221
108k
        iter = fArray;
222
108k
        T* stop = fArray + count;
223
656k
        while (iter < stop) {
224
547k
            new (iter++) T;
225
547k
        }
226
108k
    }
skia_private::AutoSTArray<64, SkGlyph const*>::reset(int)
Line
Count
Source
195
2.20k
    void reset(int count) {
196
2.20k
        T* start = fArray;
197
2.20k
        T* iter = start + fCount;
198
3.27k
        while (iter > start) {
199
1.06k
            (--iter)->~T();
200
1.06k
        }
201
202
2.20k
        SkASSERT(count >= 0);
203
2.20k
        if (fCount != count) {
204
1.15k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
0
                SkASSERT((T*) fStorage != fArray);
207
0
                sk_free(fArray);
208
0
            }
209
210
1.15k
            if (count > kCount) {
211
0
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
1.15k
            } else if (count > 0) {
213
577
                fArray = (T*) fStorage;
214
577
            } else {
215
577
                fArray = nullptr;
216
577
            }
217
218
1.15k
            fCount = count;
219
1.15k
        }
220
221
2.20k
        iter = fArray;
222
2.20k
        T* stop = fArray + count;
223
3.27k
        while (iter < stop) {
224
1.06k
            new (iter++) T;
225
1.06k
        }
226
2.20k
    }
skia_private::AutoSTArray<16, SkRect>::reset(int)
Line
Count
Source
195
5.78k
    void reset(int count) {
196
5.78k
        T* start = fArray;
197
5.78k
        T* iter = start + fCount;
198
21.7k
        while (iter > start) {
199
15.9k
            (--iter)->~T();
200
15.9k
        }
201
202
5.78k
        SkASSERT(count >= 0);
203
5.78k
        if (fCount != count) {
204
5.78k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
317
                SkASSERT((T*) fStorage != fArray);
207
317
                sk_free(fArray);
208
317
            }
209
210
5.78k
            if (count > kCount) {
211
317
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
5.46k
            } else if (count > 0) {
213
2.57k
                fArray = (T*) fStorage;
214
2.89k
            } else {
215
2.89k
                fArray = nullptr;
216
2.89k
            }
217
218
5.78k
            fCount = count;
219
5.78k
        }
220
221
5.78k
        iter = fArray;
222
5.78k
        T* stop = fArray + count;
223
21.7k
        while (iter < stop) {
224
15.9k
            new (iter++) T;
225
15.9k
        }
226
5.78k
    }
skia_private::AutoSTArray<4, float>::reset(int)
Line
Count
Source
195
770k
    void reset(int count) {
196
770k
        T* start = fArray;
197
770k
        T* iter = start + fCount;
198
804k
        while (iter > start) {
199
34.3k
            (--iter)->~T();
200
34.3k
        }
201
202
770k
        SkASSERT(count >= 0);
203
770k
        if (fCount != count) {
204
4.22k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
1.67k
                SkASSERT((T*) fStorage != fArray);
207
1.67k
                sk_free(fArray);
208
1.67k
            }
209
210
4.22k
            if (count > kCount) {
211
1.67k
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
2.54k
            } else if (count > 0) {
213
436
                fArray = (T*) fStorage;
214
2.11k
            } else {
215
2.11k
                fArray = nullptr;
216
2.11k
            }
217
218
4.22k
            fCount = count;
219
4.22k
        }
220
221
770k
        iter = fArray;
222
770k
        T* stop = fArray + count;
223
804k
        while (iter < stop) {
224
34.3k
            new (iter++) T;
225
34.3k
        }
226
770k
    }
skia_private::AutoSTArray<8, unsigned int>::reset(int)
Line
Count
Source
195
490k
    void reset(int count) {
196
490k
        T* start = fArray;
197
490k
        T* iter = start + fCount;
198
564k
        while (iter > start) {
199
74.3k
            (--iter)->~T();
200
74.3k
        }
201
202
490k
        SkASSERT(count >= 0);
203
490k
        if (fCount != count) {
204
16.3k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
7.40k
                SkASSERT((T*) fStorage != fArray);
207
7.40k
                sk_free(fArray);
208
7.40k
            }
209
210
16.3k
            if (count > kCount) {
211
7.40k
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
8.94k
            } else if (count > 0) {
213
772
                fArray = (T*) fStorage;
214
8.17k
            } else {
215
8.17k
                fArray = nullptr;
216
8.17k
            }
217
218
16.3k
            fCount = count;
219
16.3k
        }
220
221
490k
        iter = fArray;
222
490k
        T* stop = fArray + count;
223
564k
        while (iter < stop) {
224
74.3k
            new (iter++) T;
225
74.3k
        }
226
490k
    }
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::reset(int)
skia_private::AutoSTArray<32, float>::reset(int)
Line
Count
Source
195
1.53k
    void reset(int count) {
196
1.53k
        T* start = fArray;
197
1.53k
        T* iter = start + fCount;
198
8.73k
        while (iter > start) {
199
7.20k
            (--iter)->~T();
200
7.20k
        }
201
202
1.53k
        SkASSERT(count >= 0);
203
1.53k
        if (fCount != count) {
204
1.52k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
14
                SkASSERT((T*) fStorage != fArray);
207
14
                sk_free(fArray);
208
14
            }
209
210
1.52k
            if (count > kCount) {
211
14
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
1.51k
            } else if (count > 0) {
213
748
                fArray = (T*) fStorage;
214
762
            } else {
215
762
                fArray = nullptr;
216
762
            }
217
218
1.52k
            fCount = count;
219
1.52k
        }
220
221
1.53k
        iter = fArray;
222
1.53k
        T* stop = fArray + count;
223
8.73k
        while (iter < stop) {
224
7.20k
            new (iter++) T;
225
7.20k
        }
226
1.53k
    }
skia_private::AutoSTArray<16, float>::reset(int)
Line
Count
Source
195
202
    void reset(int count) {
196
202
        T* start = fArray;
197
202
        T* iter = start + fCount;
198
15.3k
        while (iter > start) {
199
15.1k
            (--iter)->~T();
200
15.1k
        }
201
202
202
        SkASSERT(count >= 0);
203
202
        if (fCount != count) {
204
174
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
65
                SkASSERT((T*) fStorage != fArray);
207
65
                sk_free(fArray);
208
65
            }
209
210
174
            if (count > kCount) {
211
65
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
109
            } else if (count > 0) {
213
22
                fArray = (T*) fStorage;
214
87
            } else {
215
87
                fArray = nullptr;
216
87
            }
217
218
174
            fCount = count;
219
174
        }
220
221
202
        iter = fArray;
222
202
        T* stop = fArray + count;
223
15.3k
        while (iter < stop) {
224
15.1k
            new (iter++) T;
225
15.1k
        }
226
202
    }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::reset(int)
skia_private::AutoSTArray<24, unsigned int>::reset(int)
Line
Count
Source
195
12.9k
    void reset(int count) {
196
12.9k
        T* start = fArray;
197
12.9k
        T* iter = start + fCount;
198
138k
        while (iter > start) {
199
125k
            (--iter)->~T();
200
125k
        }
201
202
12.9k
        SkASSERT(count >= 0);
203
12.9k
        if (fCount != count) {
204
12.9k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
142
                SkASSERT((T*) fStorage != fArray);
207
142
                sk_free(fArray);
208
142
            }
209
210
12.9k
            if (count > kCount) {
211
142
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
12.8k
            } else if (count > 0) {
213
6.32k
                fArray = (T*) fStorage;
214
6.47k
            } else {
215
6.47k
                fArray = nullptr;
216
6.47k
            }
217
218
12.9k
            fCount = count;
219
12.9k
        }
220
221
12.9k
        iter = fArray;
222
12.9k
        T* stop = fArray + count;
223
138k
        while (iter < stop) {
224
125k
            new (iter++) T;
225
125k
        }
226
12.9k
    }
skia_private::AutoSTArray<14, GrMipLevel>::reset(int)
Line
Count
Source
195
215k
    void reset(int count) {
196
215k
        T* start = fArray;
197
215k
        T* iter = start + fCount;
198
323k
        while (iter > start) {
199
107k
            (--iter)->~T();
200
107k
        }
201
202
215k
        SkASSERT(count >= 0);
203
215k
        if (fCount != count) {
204
215k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
0
                SkASSERT((T*) fStorage != fArray);
207
0
                sk_free(fArray);
208
0
            }
209
210
215k
            if (count > kCount) {
211
0
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
215k
            } else if (count > 0) {
213
107k
                fArray = (T*) fStorage;
214
107k
            } else {
215
107k
                fArray = nullptr;
216
107k
            }
217
218
215k
            fCount = count;
219
215k
        }
220
221
215k
        iter = fArray;
222
215k
        T* stop = fArray + count;
223
323k
        while (iter < stop) {
224
107k
            new (iter++) T;
225
107k
        }
226
215k
    }
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::reset(int)
Line
Count
Source
195
215k
    void reset(int count) {
196
215k
        T* start = fArray;
197
215k
        T* iter = start + fCount;
198
323k
        while (iter > start) {
199
107k
            (--iter)->~T();
200
107k
        }
201
202
215k
        SkASSERT(count >= 0);
203
215k
        if (fCount != count) {
204
215k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
0
                SkASSERT((T*) fStorage != fArray);
207
0
                sk_free(fArray);
208
0
            }
209
210
215k
            if (count > kCount) {
211
0
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
215k
            } else if (count > 0) {
213
107k
                fArray = (T*) fStorage;
214
107k
            } else {
215
107k
                fArray = nullptr;
216
107k
            }
217
218
215k
            fCount = count;
219
215k
        }
220
221
215k
        iter = fArray;
222
215k
        T* stop = fArray + count;
223
323k
        while (iter < stop) {
224
107k
            new (iter++) T;
225
107k
        }
226
215k
    }
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::reset(int)
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<16, unsigned int>::reset(int)
skia_private::AutoSTArray<64, int>::reset(int)
Line
Count
Source
195
2.98k
    void reset(int count) {
196
2.98k
        T* start = fArray;
197
2.98k
        T* iter = start + fCount;
198
15.7k
        while (iter > start) {
199
12.7k
            (--iter)->~T();
200
12.7k
        }
201
202
2.98k
        SkASSERT(count >= 0);
203
2.98k
        if (fCount != count) {
204
2.98k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
5
                SkASSERT((T*) fStorage != fArray);
207
5
                sk_free(fArray);
208
5
            }
209
210
2.98k
            if (count > kCount) {
211
5
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
2.97k
            } else if (count > 0) {
213
1.48k
                fArray = (T*) fStorage;
214
1.49k
            } else {
215
1.49k
                fArray = nullptr;
216
1.49k
            }
217
218
2.98k
            fCount = count;
219
2.98k
        }
220
221
2.98k
        iter = fArray;
222
2.98k
        T* stop = fArray + count;
223
15.7k
        while (iter < stop) {
224
12.7k
            new (iter++) T;
225
12.7k
        }
226
2.98k
    }
skia_private::AutoSTArray<64, TriangulationVertex>::reset(int)
Line
Count
Source
195
1.49k
    void reset(int count) {
196
1.49k
        T* start = fArray;
197
1.49k
        T* iter = start + fCount;
198
59.7k
        while (iter > start) {
199
58.3k
            (--iter)->~T();
200
58.3k
        }
201
202
1.49k
        SkASSERT(count >= 0);
203
1.49k
        if (fCount != count) {
204
1.49k
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
132
                SkASSERT((T*) fStorage != fArray);
207
132
                sk_free(fArray);
208
132
            }
209
210
1.49k
            if (count > kCount) {
211
132
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
1.36k
            } else if (count > 0) {
213
616
                fArray = (T*) fStorage;
214
748
            } else {
215
748
                fArray = nullptr;
216
748
            }
217
218
1.49k
            fCount = count;
219
1.49k
        }
220
221
1.49k
        iter = fArray;
222
1.49k
        T* stop = fArray + count;
223
59.7k
        while (iter < stop) {
224
58.3k
            new (iter++) T;
225
58.3k
        }
226
1.49k
    }
skia_private::AutoSTArray<64, SkRect>::reset(int)
Line
Count
Source
195
2
    void reset(int count) {
196
2
        T* start = fArray;
197
2
        T* iter = start + fCount;
198
3
        while (iter > start) {
199
1
            (--iter)->~T();
200
1
        }
201
202
2
        SkASSERT(count >= 0);
203
2
        if (fCount != count) {
204
2
            if (fCount > kCount) {
205
                // 'fArray' was allocated last time so free it now
206
0
                SkASSERT((T*) fStorage != fArray);
207
0
                sk_free(fArray);
208
0
            }
209
210
2
            if (count > kCount) {
211
0
                fArray = (T*) sk_malloc_throw(count, sizeof(T));
212
2
            } else if (count > 0) {
213
1
                fArray = (T*) fStorage;
214
1
            } else {
215
1
                fArray = nullptr;
216
1
            }
217
218
2
            fCount = count;
219
2
        }
220
221
2
        iter = fArray;
222
2
        T* stop = fArray + count;
223
3
        while (iter < stop) {
224
1
            new (iter++) T;
225
1
        }
226
2
    }
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<20, SkGlyph const*>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<64, SkGlyph const*>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, float>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<8, unsigned int>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<24, unsigned int>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<14, GrMipLevel>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::reset(int)
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<32, float>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<16, float>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<64, TriangulationVertex>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<64, SkRect>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::reset(int)
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::reset(int)
227
228
    /** Return the number of T elements in the array
229
     */
230
2.82M
    int count() const { return fCount; }
Unexecuted instantiation: skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::count() const
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::count() const
Line
Count
Source
230
1.48M
    int count() const { return fCount; }
skia_private::AutoSTArray<4, float>::count() const
Line
Count
Source
230
614k
    int count() const { return fCount; }
skia_private::AutoSTArray<24, unsigned int>::count() const
Line
Count
Source
230
24.4k
    int count() const { return fCount; }
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::count() const
skia_private::AutoSTArray<8, unsigned int>::count() const
Line
Count
Source
230
703k
    int count() const { return fCount; }
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::count() const
231
232
    /** Return the array of T elements. Will be NULL if count == 0
233
     */
234
1.15M
    T* get() const { return fArray; }
skia_private::AutoSTArray<32, unsigned short>::get() const
Line
Count
Source
234
732
    T* get() const { return fArray; }
skia_private::AutoSTArray<20, SkGlyph const*>::get() const
Line
Count
Source
234
54.4k
    T* get() const { return fArray; }
skia_private::AutoSTArray<64, SkGlyph const*>::get() const
Line
Count
Source
234
1.06k
    T* get() const { return fArray; }
skia_private::AutoSTArray<16, SkRect>::get() const
Line
Count
Source
234
2.89k
    T* get() const { return fArray; }
skia_private::AutoSTArray<4, float>::get() const
Line
Count
Source
234
615k
    T* get() const { return fArray; }
skia_private::AutoSTArray<32, float>::get() const
Line
Count
Source
234
1.52k
    T* get() const { return fArray; }
skia_private::AutoSTArray<16, float>::get() const
Line
Count
Source
234
190
    T* get() const { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::get() const
skia_private::AutoSTArray<24, unsigned int>::get() const
Line
Count
Source
234
19.1k
    T* get() const { return fArray; }
skia_private::AutoSTArray<14, GrMipLevel>::get() const
Line
Count
Source
234
107k
    T* get() const { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::get() const
skia_private::AutoSTArray<8, unsigned int>::get() const
Line
Count
Source
234
349k
    T* get() const { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::get() const
Unexecuted instantiation: skia_private::AutoSTArray<16, unsigned int>::get() const
skia_private::AutoSTArray<64, int>::get() const
Line
Count
Source
234
1.49k
    T* get() const { return fArray; }
skia_private::AutoSTArray<64, SkRect>::get() const
Line
Count
Source
234
1
    T* get() const { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::get() const
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::get() const
235
236
0
    T* begin() { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::begin()
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::begin()
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::begin()
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::begin()
237
238
0
    const T* begin() const { return fArray; }
239
240
0
    T* end() { return fArray + fCount; }
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::end()
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::end()
241
242
0
    const T* end() const { return fArray + fCount; }
243
244
    /** Return the nth element in the array
245
     */
246
5.33M
    T&  operator[](int index) const {
247
5.33M
        return fArray[sk_collection_check_bounds(index, fCount)];
248
5.33M
    }
skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::operator[](int) const
Line
Count
Source
246
212k
    T&  operator[](int index) const {
247
212k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
212k
    }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::operator[](int) const
Line
Count
Source
246
4.38M
    T&  operator[](int index) const {
247
4.38M
        return fArray[sk_collection_check_bounds(index, fCount)];
248
4.38M
    }
skia_private::AutoSTArray<16, SkRect>::operator[](int) const
Line
Count
Source
246
15.9k
    T&  operator[](int index) const {
247
15.9k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
15.9k
    }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::operator[](int) const
skia_private::AutoSTArray<14, GrMipLevel>::operator[](int) const
Line
Count
Source
246
107k
    T&  operator[](int index) const {
247
107k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
107k
    }
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::operator[](int) const
Line
Count
Source
246
107k
    T&  operator[](int index) const {
247
107k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
107k
    }
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::operator[](int) const
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::operator[](int) const
skia_private::AutoSTArray<24, unsigned int>::operator[](int) const
Line
Count
Source
246
13.0k
    T&  operator[](int index) const {
247
13.0k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
13.0k
    }
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::operator[](int) const
skia_private::AutoSTArray<64, int>::operator[](int) const
Line
Count
Source
246
12.7k
    T&  operator[](int index) const {
247
12.7k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
12.7k
    }
skia_private::AutoSTArray<64, TriangulationVertex>::operator[](int) const
Line
Count
Source
246
481k
    T&  operator[](int index) const {
247
481k
        return fArray[sk_collection_check_bounds(index, fCount)];
248
481k
    }
skia_private::AutoSTArray<64, SkRect>::operator[](int) const
Line
Count
Source
246
1
    T&  operator[](int index) const {
247
1
        return fArray[sk_collection_check_bounds(index, fCount)];
248
1
    }
Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::operator[](int) const
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::operator[](int) const
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::operator[](int) const
Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<skgpu::graphite::PrecompileImageFilter> >::operator[](int) const
249
250
    /** Aliases matching other types, like std::vector. */
251
    const T* data() const { return fArray; }
252
791
    T* data() { return fArray; }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::data()
Line
Count
Source
252
791
    T* data() { return fArray; }
Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::data()
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::data()
Unexecuted instantiation: skia_private::AutoSTArray<4, int>::data()
253
791
    size_t size() const { return fCount; }
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::size() const
Line
Count
Source
253
791
    size_t size() const { return fCount; }
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::size() const
254
255
private:
256
#if defined(SK_BUILD_FOR_GOOGLE3)
257
    // Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max,
258
    // but some functions have multiple large stack allocations.
259
    static const int kMaxBytes = 4 * 1024;
260
    static const int kCount = kCountRequested * sizeof(T) > kMaxBytes
261
        ? kMaxBytes / sizeof(T)
262
        : kCountRequested;
263
#else
264
    static const int kCount = kCountRequested;
265
#endif
266
267
    int fCount;
268
    T* fArray;
269
    alignas(T) char fStorage[kCount * sizeof(T)];
270
};
271
272
/** Manages an array of T elements, freeing the array in the destructor.
273
 *  Does NOT call any constructors/destructors on T (T must be POD).
274
 */
275
template <typename T,
276
          typename = std::enable_if_t<std::is_trivially_default_constructible<T>::value &&
277
                                      std::is_trivially_destructible<T>::value>>
278
class AutoTMalloc  {
279
public:
280
    /** Takes ownership of the ptr. The ptr must be a value which can be passed to sk_free. */
281
48.9M
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
skia_private::AutoTMalloc<SkPoint, void>::AutoTMalloc(SkPoint*)
Line
Count
Source
281
709k
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
skia_private::AutoTMalloc<unsigned char, void>::AutoTMalloc(unsigned char*)
Line
Count
Source
281
159k
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
skia_private::AutoTMalloc<SkRecord::Record, void>::AutoTMalloc(SkRecord::Record*)
Line
Count
Source
281
127k
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::AutoTMalloc(SkPicture const**)
skia_private::AutoTMalloc<int, void>::AutoTMalloc(int*)
Line
Count
Source
281
10.1M
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::AutoTMalloc(char*)
skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::AutoTMalloc(SkFontArguments::Palette::Override*)
Line
Count
Source
281
37.7M
    explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {}
282
283
    /** Allocates space for 'count' Ts. */
284
    explicit AutoTMalloc(size_t count)
285
27.4k
        : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {}
skia_private::AutoTMalloc<unsigned int, void>::AutoTMalloc(unsigned long)
Line
Count
Source
285
8.69k
        : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {}
Unexecuted instantiation: skia_private::AutoTMalloc<SkBBoxHierarchy::Metadata, void>::AutoTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::AutoTMalloc(unsigned long)
skia_private::AutoTMalloc<unsigned char, void>::AutoTMalloc(unsigned long)
Line
Count
Source
285
16.8k
        : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {}
skia_private::AutoTMalloc<char, void>::AutoTMalloc(unsigned long)
Line
Count
Source
285
1.95k
        : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {}
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::AutoTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoTMalloc<skgpu::graphite::MonotonicValue<skgpu::graphite::CompressedPaintersOrderSequence>, void>::AutoTMalloc(unsigned long)
286
287
    AutoTMalloc(AutoTMalloc&&) = default;
288
    AutoTMalloc& operator=(AutoTMalloc&&) = default;
289
290
    /** Resize the memory area pointed to by the current ptr preserving contents. */
291
3.04M
    void realloc(size_t count) {
292
3.04M
        fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr);
293
3.04M
    }
skia_private::AutoTMalloc<SkRecord::Record, void>::realloc(unsigned long)
Line
Count
Source
291
131k
    void realloc(size_t count) {
292
131k
        fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr);
293
131k
    }
skia_private::AutoTMalloc<int, void>::realloc(unsigned long)
Line
Count
Source
291
2.86M
    void realloc(size_t count) {
292
2.86M
        fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr);
293
2.86M
    }
skia_private::AutoTMalloc<unsigned char, void>::realloc(unsigned long)
Line
Count
Source
291
50.0k
    void realloc(size_t count) {
292
50.0k
        fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr);
293
50.0k
    }
294
295
    /** Resize the memory area pointed to by the current ptr without preserving contents. */
296
51.1k
    T* reset(size_t count = 0) {
297
51.1k
        fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr);
298
51.1k
        return this->get();
299
51.1k
    }
skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::reset(unsigned long)
Line
Count
Source
296
35.4k
    T* reset(size_t count = 0) {
297
35.4k
        fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr);
298
35.4k
        return this->get();
299
35.4k
    }
skia_private::AutoTMalloc<SkPoint, void>::reset(unsigned long)
Line
Count
Source
296
10.1k
    T* reset(size_t count = 0) {
297
10.1k
        fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr);
298
10.1k
        return this->get();
299
10.1k
    }
skia_private::AutoTMalloc<unsigned char, void>::reset(unsigned long)
Line
Count
Source
296
5.56k
    T* reset(size_t count = 0) {
297
5.56k
        fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr);
298
5.56k
        return this->get();
299
5.56k
    }
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::reset(unsigned long)
300
301
19.6M
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<unsigned int, void>::get() const
Line
Count
Source
301
8.69k
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::get() const
Line
Count
Source
301
450k
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<SkRecord::Record, void>::get() const
Line
Count
Source
301
262k
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<int, void>::get() const
Line
Count
Source
301
3.45M
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<unsigned char, void>::get() const
Line
Count
Source
301
15.4M
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<SkPoint, void>::get() const
Line
Count
Source
301
10.1k
    T* get() const { return fPtr.get(); }
skia_private::AutoTMalloc<char, void>::get() const
Line
Count
Source
301
3.91k
    T* get() const { return fPtr.get(); }
302
303
25.3k
    operator T*() { return fPtr.get(); }
Unexecuted instantiation: skia_private::AutoTMalloc<SkBBoxHierarchy::Metadata, void>::operator SkBBoxHierarchy::Metadata*()
skia_private::AutoTMalloc<SkPoint, void>::operator SkPoint*()
Line
Count
Source
303
23.2k
    operator T*() { return fPtr.get(); }
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::operator char*()
skia_private::AutoTMalloc<unsigned char, void>::operator unsigned char*()
Line
Count
Source
303
2.07k
    operator T*() { return fPtr.get(); }
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::operator float*()
304
305
0
    operator const T*() const { return fPtr.get(); }
306
307
753M
    T& operator[](int index) { return fPtr.get()[index]; }
skia_private::AutoTMalloc<unsigned int, void>::operator[](int)
Line
Count
Source
307
300M
    T& operator[](int index) { return fPtr.get()[index]; }
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::operator[](int)
skia_private::AutoTMalloc<SkRecord::Record, void>::operator[](int)
Line
Count
Source
307
2.38M
    T& operator[](int index) { return fPtr.get()[index]; }
skia_private::AutoTMalloc<unsigned char, void>::operator[](int)
Line
Count
Source
307
450M
    T& operator[](int index) { return fPtr.get()[index]; }
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::operator[](int)
skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::operator[](int)
Line
Count
Source
307
642k
    T& operator[](int index) { return fPtr.get()[index]; }
308
309
173k
    const T& operator[](int index) const { return fPtr.get()[index]; }
skia_private::AutoTMalloc<SkRecord::Record, void>::operator[](int) const
Line
Count
Source
309
173k
    const T& operator[](int index) const { return fPtr.get()[index]; }
Unexecuted instantiation: skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::operator[](int) const
310
311
    /** Aliases matching other types, like std::vector. */
312
0
    const T* data() const { return fPtr.get(); }
313
0
    T* data() { return fPtr.get(); }
314
315
    /**
316
     *  Transfer ownership of the ptr to the caller, setting the internal
317
     *  pointer to NULL. Note that this differs from get(), which also returns
318
     *  the pointer, but it does not transfer ownership.
319
     */
320
18.5k
    T* release() { return fPtr.release(); }
skia_private::AutoTMalloc<unsigned int, void>::release()
Line
Count
Source
320
8.69k
    T* release() { return fPtr.release(); }
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::release()
skia_private::AutoTMalloc<unsigned char, void>::release()
Line
Count
Source
320
9.81k
    T* release() { return fPtr.release(); }
321
322
private:
323
    std::unique_ptr<T, SkOverloadedFunctionObject<void(void*), sk_free>> fPtr;
324
};
325
326
template <size_t kCountRequested,
327
          typename T,
328
          typename = std::enable_if_t<std::is_trivially_default_constructible<T>::value &&
329
                                      std::is_trivially_destructible<T>::value>>
330
class AutoSTMalloc {
331
public:
332
49.7M
    AutoSTMalloc() : fPtr(fTStorage) {}
skia_private::AutoSTMalloc<8ul, unsigned int, void>::AutoSTMalloc()
Line
Count
Source
332
1.92M
    AutoSTMalloc() : fPtr(fTStorage) {}
skia_private::AutoSTMalloc<17ul, SkPoint, void>::AutoSTMalloc()
Line
Count
Source
332
10.0M
    AutoSTMalloc() : fPtr(fTStorage) {}
skia_private::AutoSTMalloc<256ul, int, void>::AutoSTMalloc()
Line
Count
Source
332
33.0k
    AutoSTMalloc() : fPtr(fTStorage) {}
skia_private::AutoSTMalloc<80ul, unsigned char, void>::AutoSTMalloc()
Line
Count
Source
332
10.6k
    AutoSTMalloc() : fPtr(fTStorage) {}
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, float, void>::AutoSTMalloc()
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::AutoSTMalloc()
Line
Count
Source
332
37.7M
    AutoSTMalloc() : fPtr(fTStorage) {}
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::AutoSTMalloc()
333
334
1.89M
    AutoSTMalloc(size_t count) {
335
1.89M
        if (count > kCount) {
336
8.37k
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
1.88M
        } else if (count) {
338
1.75M
            fPtr = fTStorage;
339
1.75M
        } else {
340
129k
            fPtr = nullptr;
341
129k
        }
342
1.89M
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::AutoSTMalloc(unsigned long)
skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
881k
    AutoSTMalloc(size_t count) {
335
881k
        if (count > kCount) {
336
7.86k
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
873k
        } else if (count) {
338
873k
            fPtr = fTStorage;
339
873k
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
881k
    }
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
881k
    AutoSTMalloc(size_t count) {
335
881k
        if (count > kCount) {
336
0
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
881k
        } else if (count) {
338
881k
            fPtr = fTStorage;
339
881k
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
881k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::AutoSTMalloc(unsigned long)
skia_private::AutoSTMalloc<4ul, int, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
86.3k
    AutoSTMalloc(size_t count) {
335
86.3k
        if (count > kCount) {
336
18
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
86.3k
        } else if (count) {
338
873
            fPtr = fTStorage;
339
85.4k
        } else {
340
85.4k
            fPtr = nullptr;
341
85.4k
        }
342
86.3k
    }
skia_private::AutoSTMalloc<4ul, long, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
594
    AutoSTMalloc(size_t count) {
335
594
        if (count > kCount) {
336
12
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
582
        } else if (count) {
338
582
            fPtr = fTStorage;
339
582
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
594
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::AutoSTMalloc(unsigned long)
skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
44.5k
    AutoSTMalloc(size_t count) {
335
44.5k
        if (count > kCount) {
336
42
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
44.4k
        } else if (count) {
338
178
            fPtr = fTStorage;
339
44.2k
        } else {
340
44.2k
            fPtr = nullptr;
341
44.2k
        }
342
44.5k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::AutoSTMalloc(unsigned long)
skia_private::AutoSTMalloc<64ul, unsigned short, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
812
    AutoSTMalloc(size_t count) {
335
812
        if (count > kCount) {
336
180
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
632
        } else if (count) {
338
632
            fPtr = fTStorage;
339
632
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
812
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned int, void>::AutoSTMalloc(unsigned long)
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
180
    AutoSTMalloc(size_t count) {
335
180
        if (count > kCount) {
336
28
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
152
        } else if (count) {
338
152
            fPtr = fTStorage;
339
152
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
180
    }
skia_private::AutoSTMalloc<64ul, SkPoint, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
1.31k
    AutoSTMalloc(size_t count) {
335
1.31k
        if (count > kCount) {
336
225
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
1.09k
        } else if (count) {
338
1.05k
            fPtr = fTStorage;
339
1.05k
        } else {
340
36
            fPtr = nullptr;
341
36
        }
342
1.31k
    }
skia_private::AutoSTMalloc<64ul, int, void>::AutoSTMalloc(unsigned long)
Line
Count
Source
334
344
    AutoSTMalloc(size_t count) {
335
344
        if (count > kCount) {
336
0
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
337
344
        } else if (count) {
338
344
            fPtr = fTStorage;
339
344
        } else {
340
0
            fPtr = nullptr;
341
0
        }
342
344
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, int, void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::AutoSTMalloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::AutoSTMalloc(unsigned long)
343
344
    AutoSTMalloc(AutoSTMalloc&&) = delete;
345
    AutoSTMalloc(const AutoSTMalloc&) = delete;
346
    AutoSTMalloc& operator=(AutoSTMalloc&&) = delete;
347
    AutoSTMalloc& operator=(const AutoSTMalloc&) = delete;
348
349
51.6M
    ~AutoSTMalloc() {
350
51.6M
        if (fPtr != fTStorage) {
351
935k
            sk_free(fPtr);
352
935k
        }
353
51.6M
    }
skia_private::AutoSTMalloc<8ul, unsigned int, void>::~AutoSTMalloc()
Line
Count
Source
349
1.92M
    ~AutoSTMalloc() {
350
1.92M
        if (fPtr != fTStorage) {
351
5.47k
            sk_free(fPtr);
352
5.47k
        }
353
1.92M
    }
skia_private::AutoSTMalloc<17ul, SkPoint, void>::~AutoSTMalloc()
Line
Count
Source
349
10.0M
    ~AutoSTMalloc() {
350
10.0M
        if (fPtr != fTStorage) {
351
766k
            sk_free(fPtr);
352
766k
        }
353
10.0M
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::~AutoSTMalloc()
skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::~AutoSTMalloc()
Line
Count
Source
349
881k
    ~AutoSTMalloc() {
350
881k
        if (fPtr != fTStorage) {
351
7.86k
            sk_free(fPtr);
352
7.86k
        }
353
881k
    }
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::~AutoSTMalloc()
Line
Count
Source
349
881k
    ~AutoSTMalloc() {
350
881k
        if (fPtr != fTStorage) {
351
0
            sk_free(fPtr);
352
0
        }
353
881k
    }
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::~AutoSTMalloc()
Line
Count
Source
349
37.7M
    ~AutoSTMalloc() {
350
37.7M
        if (fPtr != fTStorage) {
351
23.7k
            sk_free(fPtr);
352
23.7k
        }
353
37.7M
    }
skia_private::AutoSTMalloc<256ul, int, void>::~AutoSTMalloc()
Line
Count
Source
349
33.0k
    ~AutoSTMalloc() {
350
33.0k
        if (fPtr != fTStorage) {
351
4
            sk_free(fPtr);
352
4
        }
353
33.0k
    }
skia_private::AutoSTMalloc<80ul, unsigned char, void>::~AutoSTMalloc()
Line
Count
Source
349
10.6k
    ~AutoSTMalloc() {
350
10.6k
        if (fPtr != fTStorage) {
351
2.32k
            sk_free(fPtr);
352
2.32k
        }
353
10.6k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, float, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::~AutoSTMalloc()
skia_private::AutoSTMalloc<4ul, int, void>::~AutoSTMalloc()
Line
Count
Source
349
86.3k
    ~AutoSTMalloc() {
350
86.3k
        if (fPtr != fTStorage) {
351
85.4k
            sk_free(fPtr);
352
85.4k
        }
353
86.3k
    }
skia_private::AutoSTMalloc<4ul, long, void>::~AutoSTMalloc()
Line
Count
Source
349
594
    ~AutoSTMalloc() {
350
594
        if (fPtr != fTStorage) {
351
12
            sk_free(fPtr);
352
12
        }
353
594
    }
skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::~AutoSTMalloc()
Line
Count
Source
349
44.4k
    ~AutoSTMalloc() {
350
44.4k
        if (fPtr != fTStorage) {
351
44.3k
            sk_free(fPtr);
352
44.3k
        }
353
44.4k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::~AutoSTMalloc()
skia_private::AutoSTMalloc<64ul, unsigned short, void>::~AutoSTMalloc()
Line
Count
Source
349
812
    ~AutoSTMalloc() {
350
812
        if (fPtr != fTStorage) {
351
180
            sk_free(fPtr);
352
180
        }
353
812
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned int, void>::~AutoSTMalloc()
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::~AutoSTMalloc()
Line
Count
Source
349
180
    ~AutoSTMalloc() {
350
180
        if (fPtr != fTStorage) {
351
28
            sk_free(fPtr);
352
28
        }
353
180
    }
skia_private::AutoSTMalloc<64ul, SkPoint, void>::~AutoSTMalloc()
Line
Count
Source
349
1.31k
    ~AutoSTMalloc() {
350
1.31k
        if (fPtr != fTStorage) {
351
261
            sk_free(fPtr);
352
261
        }
353
1.31k
    }
skia_private::AutoSTMalloc<64ul, int, void>::~AutoSTMalloc()
Line
Count
Source
349
344
    ~AutoSTMalloc() {
350
344
        if (fPtr != fTStorage) {
351
0
            sk_free(fPtr);
352
0
        }
353
344
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::~AutoSTMalloc()
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::~AutoSTMalloc()
354
355
    // doesn't preserve contents
356
14.4M
    T* reset(size_t count) {
357
14.4M
        if (fPtr != fTStorage) {
358
3.31M
            sk_free(fPtr);
359
3.31M
        }
360
14.4M
        if (count > kCount) {
361
4.09M
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
10.3M
        } else if (count) {
363
10.3M
            fPtr = fTStorage;
364
10.3M
        } else {
365
24.1k
            fPtr = nullptr;
366
24.1k
        }
367
14.4M
        return fPtr;
368
14.4M
    }
skia_private::AutoSTMalloc<8ul, unsigned int, void>::reset(unsigned long)
Line
Count
Source
356
3.70M
    T* reset(size_t count) {
357
3.70M
        if (fPtr != fTStorage) {
358
772
            sk_free(fPtr);
359
772
        }
360
3.70M
        if (count > kCount) {
361
6.36k
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
3.69M
        } else if (count) {
363
3.69M
            fPtr = fTStorage;
364
3.69M
        } else {
365
0
            fPtr = nullptr;
366
0
        }
367
3.70M
        return fPtr;
368
3.70M
    }
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::reset(unsigned long)
Line
Count
Source
356
28.3k
    T* reset(size_t count) {
357
28.3k
        if (fPtr != fTStorage) {
358
3.73k
            sk_free(fPtr);
359
3.73k
        }
360
28.3k
        if (count > kCount) {
361
3.30k
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
25.0k
        } else if (count) {
363
850
            fPtr = fTStorage;
364
24.1k
        } else {
365
24.1k
            fPtr = nullptr;
366
24.1k
        }
367
28.3k
        return fPtr;
368
28.3k
    }
skia_private::AutoSTMalloc<17ul, SkPoint, void>::reset(unsigned long)
Line
Count
Source
356
10.6M
    T* reset(size_t count) {
357
10.6M
        if (fPtr != fTStorage) {
358
3.31M
            sk_free(fPtr);
359
3.31M
        }
360
10.6M
        if (count > kCount) {
361
4.07M
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
6.60M
        } else if (count) {
363
6.60M
            fPtr = fTStorage;
364
6.60M
        } else {
365
0
            fPtr = nullptr;
366
0
        }
367
10.6M
        return fPtr;
368
10.6M
    }
skia_private::AutoSTMalloc<256ul, int, void>::reset(unsigned long)
Line
Count
Source
356
20.3k
    T* reset(size_t count) {
357
20.3k
        if (fPtr != fTStorage) {
358
0
            sk_free(fPtr);
359
0
        }
360
20.3k
        if (count > kCount) {
361
4
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
20.3k
        } else if (count) {
363
20.3k
            fPtr = fTStorage;
364
20.3k
        } else {
365
0
            fPtr = nullptr;
366
0
        }
367
20.3k
        return fPtr;
368
20.3k
    }
skia_private::AutoSTMalloc<80ul, unsigned char, void>::reset(unsigned long)
Line
Count
Source
356
10.6k
    T* reset(size_t count) {
357
10.6k
        if (fPtr != fTStorage) {
358
0
            sk_free(fPtr);
359
0
        }
360
10.6k
        if (count > kCount) {
361
2.32k
            fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362
8.36k
        } else if (count) {
363
8.36k
            fPtr = fTStorage;
364
8.36k
        } else {
365
0
            fPtr = nullptr;
366
0
        }
367
10.6k
        return fPtr;
368
10.6k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, float, void>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::reset(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::reset(unsigned long)
369
370
6.29M
    T* get() const { return fPtr; }
skia_private::AutoSTMalloc<8ul, unsigned int, void>::get() const
Line
Count
Source
370
4.07M
    T* get() const { return fPtr; }
skia_private::AutoSTMalloc<4ul, int, void>::get() const
Line
Count
Source
370
42.6k
    T* get() const { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::get() const
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::get() const
Line
Count
Source
370
415k
    T* get() const { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::get() const
skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::get() const
Line
Count
Source
370
1.76M
    T* get() const { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::get() const
skia_private::AutoSTMalloc<4ul, long, void>::get() const
Line
Count
Source
370
353
    T* get() const { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned int, void>::get() const
skia_private::AutoSTMalloc<64ul, int, void>::get() const
Line
Count
Source
370
711
    T* get() const { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, int, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::get() const
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::get() const
371
372
48.5k
    operator T*() {
373
48.5k
        return fPtr;
374
48.5k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::operator skgpu::tess::MiddleOutPolygonTriangulator::StackVertex*()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, float, void>::operator float*()
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator SkFontArguments::VariationPosition::Coordinate*()
skia_private::AutoSTMalloc<4ul, int, void>::operator int*()
Line
Count
Source
372
41.8k
    operator T*() {
373
41.8k
        return fPtr;
374
41.8k
    }
skia_private::AutoSTMalloc<64ul, unsigned short, void>::operator unsigned short*()
Line
Count
Source
372
812
    operator T*() {
373
812
        return fPtr;
374
812
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::operator unsigned char*()
skia_private::AutoSTMalloc<64ul, SkPoint, void>::operator SkPoint*()
Line
Count
Source
372
5.87k
    operator T*() {
373
5.87k
        return fPtr;
374
5.87k
    }
375
376
    operator const T*() const {
377
        return fPtr;
378
    }
379
380
14.3M
    T& operator[](int index) {
381
14.3M
        return fPtr[index];
382
14.3M
    }
skia_private::AutoSTMalloc<8ul, unsigned int, void>::operator[](int)
Line
Count
Source
380
9.48M
    T& operator[](int index) {
381
9.48M
        return fPtr[index];
382
9.48M
    }
skia_private::AutoSTMalloc<4ul, int, void>::operator[](int)
Line
Count
Source
380
1.56k
    T& operator[](int index) {
381
1.56k
        return fPtr[index];
382
1.56k
    }
skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::operator[](int)
Line
Count
Source
380
883
    T& operator[](int index) {
381
883
        return fPtr[index];
382
883
    }
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::operator[](int)
Line
Count
Source
380
3.33M
    T& operator[](int index) {
381
3.33M
        return fPtr[index];
382
3.33M
    }
skia_private::AutoSTMalloc<256ul, int, void>::operator[](int)
Line
Count
Source
380
171k
    T& operator[](int index) {
381
171k
        return fPtr[index];
382
171k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::operator[](int)
skia_private::AutoSTMalloc<4ul, long, void>::operator[](int)
Line
Count
Source
380
836
    T& operator[](int index) {
381
836
        return fPtr[index];
382
836
    }
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator[](int)
Line
Count
Source
380
814k
    T& operator[](int index) {
381
814k
        return fPtr[index];
382
814k
    }
skia_private::AutoSTMalloc<64ul, unsigned short, void>::operator[](int)
Line
Count
Source
380
78.6k
    T& operator[](int index) {
381
78.6k
        return fPtr[index];
382
78.6k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned int, void>::operator[](int)
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::operator[](int)
Line
Count
Source
380
48.1k
    T& operator[](int index) {
381
48.1k
        return fPtr[index];
382
48.1k
    }
skia_private::AutoSTMalloc<64ul, SkPoint, void>::operator[](int)
Line
Count
Source
380
395k
    T& operator[](int index) {
381
395k
        return fPtr[index];
382
395k
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::operator[](int)
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::operator[](int)
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::operator[](int)
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::operator[](int)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::operator[](int)
383
384
13.5M
    const T& operator[](int index) const {
385
13.5M
        return fPtr[index];
386
13.5M
    }
skia_private::AutoSTMalloc<8ul, unsigned int, void>::operator[](int) const
Line
Count
Source
384
13.5M
    const T& operator[](int index) const {
385
13.5M
        return fPtr[index];
386
13.5M
    }
skia_private::AutoSTMalloc<4ul, int, void>::operator[](int) const
Line
Count
Source
384
780
    const T& operator[](int index) const {
385
780
        return fPtr[index];
386
780
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::operator[](int) const
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator[](int) const
387
388
    /** Aliases matching other types, like std::vector. */
389
    const T* data() const { return fPtr; }
390
881k
    T* data() { return fPtr; }
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::data()
Line
Count
Source
390
881k
    T* data() { return fPtr; }
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::data()
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::data()
391
392
    // Reallocs the array, can be used to shrink the allocation.  Makes no attempt to be intelligent
393
0
    void realloc(size_t count) {
394
0
        if (count > kCount) {
395
0
            if (fPtr == fTStorage) {
396
0
                fPtr = (T*)sk_malloc_throw(count, sizeof(T));
397
0
                memcpy((void*)fPtr, fTStorage, kCount * sizeof(T));
398
0
            } else {
399
0
                fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T));
400
0
            }
401
0
        } else if (count) {
402
0
            if (fPtr != fTStorage) {
403
0
                fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T));
404
0
            }
405
0
        } else {
406
0
            this->reset(0);
407
0
        }
408
0
    }
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, float, void>::realloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::realloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::realloc(unsigned long)
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::realloc(unsigned long)
409
410
private:
411
    // Since we use uint32_t storage, we might be able to get more elements for free.
412
    static const size_t kCountWithPadding = SkAlign4(kCountRequested*sizeof(T)) / sizeof(T);
413
#if defined(SK_BUILD_FOR_GOOGLE3)
414
    // Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, but some functions
415
    // have multiple large stack allocations.
416
    static const size_t kMaxBytes = 4 * 1024;
417
    static const size_t kCount = kCountRequested * sizeof(T) > kMaxBytes
418
        ? kMaxBytes / sizeof(T)
419
        : kCountWithPadding;
420
#else
421
    static const size_t kCount = kCountWithPadding;
422
#endif
423
424
    T*          fPtr;
425
    union {
426
        uint32_t    fStorage32[SkAlign4(kCount*sizeof(T)) >> 2];
427
        T           fTStorage[1];   // do NOT want to invoke T::T()
428
    };
429
};
430
431
using UniqueVoidPtr = std::unique_ptr<void, SkOverloadedFunctionObject<void(void*), sk_free>>;
432
433
}  // namespace skia_private
434
435
template<typename C, std::size_t... Is>
436
constexpr auto SkMakeArrayFromIndexSequence(C c, std::index_sequence<Is...> is)
437
-> std::array<decltype(c(std::declval<typename decltype(is)::value_type>())), sizeof...(Is)> {
438
    return {{ c(Is)... }};
439
}
440
441
template<size_t N, typename C> constexpr auto SkMakeArray(C c)
442
-> std::array<decltype(c(std::declval<typename std::index_sequence<N>::value_type>())), N> {
443
    return SkMakeArrayFromIndexSequence(c, std::make_index_sequence<N>{});
444
}
445
446
#endif