Coverage Report

Created: 2026-06-16 06:08

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/spirv-cross/spirv_cross_containers.hpp
Line
Count
Source
1
/*
2
 * Copyright 2019-2021 Hans-Kristian Arntzen
3
 * SPDX-License-Identifier: Apache-2.0 OR MIT
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
/*
19
 * At your option, you may choose to accept this material under either:
20
 *  1. The Apache License, Version 2.0, found at <http://www.apache.org/licenses/LICENSE-2.0>, or
21
 *  2. The MIT License, found at <http://opensource.org/licenses/MIT>.
22
 */
23
24
#ifndef SPIRV_CROSS_CONTAINERS_HPP
25
#define SPIRV_CROSS_CONTAINERS_HPP
26
27
#include "spirv_cross_error_handling.hpp"
28
#include <algorithm>
29
#include <exception>
30
#include <functional>
31
#include <iterator>
32
#include <limits>
33
#include <memory>
34
#include <stack>
35
#include <stddef.h>
36
#include <stdint.h>
37
#include <stdlib.h>
38
#include <string.h>
39
#include <type_traits>
40
#include <unordered_map>
41
#include <unordered_set>
42
#include <utility>
43
#include <vector>
44
45
#ifdef SPIRV_CROSS_NAMESPACE_OVERRIDE
46
#define SPIRV_CROSS_NAMESPACE SPIRV_CROSS_NAMESPACE_OVERRIDE
47
#else
48
#define SPIRV_CROSS_NAMESPACE spirv_cross
49
#endif
50
51
namespace SPIRV_CROSS_NAMESPACE
52
{
53
#ifndef SPIRV_CROSS_FORCE_STL_TYPES
54
// std::aligned_storage does not support size == 0, so roll our own.
55
template <typename T, size_t N>
56
class AlignedBuffer
57
{
58
public:
59
  T *data()
60
1.42M
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
1.42M
    return reinterpret_cast<T *>(aligned_char);
68
1.42M
#endif
69
1.42M
  }
spirv_cross::AlignedBuffer<std::__1::pair<unsigned int, unsigned int>, 8ul>::data()
Line
Count
Source
60
6.18k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.18k
    return reinterpret_cast<T *>(aligned_char);
68
6.18k
#endif
69
6.18k
  }
spirv_cross::AlignedBuffer<unsigned int, 8ul>::data()
Line
Count
Source
60
319k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
319k
    return reinterpret_cast<T *>(aligned_char);
68
319k
#endif
69
319k
  }
spirv_cross::AlignedBuffer<spirv_cross::ParsedIR::Source::Marker, 8ul>::data()
Line
Count
Source
60
13.7k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
13.7k
    return reinterpret_cast<T *>(aligned_char);
68
13.7k
#endif
69
13.7k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::data()
Line
Count
Source
60
105k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
105k
    return reinterpret_cast<T *>(aligned_char);
68
105k
#endif
69
105k
  }
spirv_cross::AlignedBuffer<unsigned char, 8ul>::data()
Line
Count
Source
60
8.84k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
8.84k
    return reinterpret_cast<T *>(aligned_char);
68
8.84k
#endif
69
8.84k
  }
spirv_cross::AlignedBuffer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::data()
Line
Count
Source
60
6.15k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.15k
    return reinterpret_cast<T *>(aligned_char);
68
6.15k
#endif
69
6.15k
  }
spirv_cross::AlignedBuffer<spv::Capability, 8ul>::data()
Line
Count
Source
60
6.16k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.16k
    return reinterpret_cast<T *>(aligned_char);
68
6.16k
#endif
69
6.16k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::data()
Line
Count
Source
60
153k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
153k
    return reinterpret_cast<T *>(aligned_char);
68
153k
#endif
69
153k
  }
spirv_cross::AlignedBuffer<spirv_cross::Variant, 8ul>::data()
Line
Count
Source
60
8.84k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
8.84k
    return reinterpret_cast<T *>(aligned_char);
68
8.84k
#endif
69
8.84k
  }
Unexecuted instantiation: spirv_cross::AlignedBuffer<spirv_cross::StringStream<4096ul, 4096ul>::Buffer, 8ul>::data()
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<bool, 8ul>::data()
Line
Count
Source
60
54.9k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
54.9k
    return reinterpret_cast<T *>(aligned_char);
68
54.9k
#endif
69
54.9k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::data()
Line
Count
Source
60
30.5k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
30.5k
    return reinterpret_cast<T *>(aligned_char);
68
30.5k
#endif
69
30.5k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::Instruction, 8ul>::data()
Line
Count
Source
60
34.9k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
34.9k
    return reinterpret_cast<T *>(aligned_char);
68
34.9k
#endif
69
34.9k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRBlock::Phi, 8ul>::data()
Line
Count
Source
60
23.6k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
23.6k
    return reinterpret_cast<T *>(aligned_char);
68
23.6k
#endif
69
23.6k
  }
spirv_cross::AlignedBuffer<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::data()
Line
Count
Source
60
47.0k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
47.0k
    return reinterpret_cast<T *>(aligned_char);
68
47.0k
#endif
69
47.0k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRBlock::Case, 8ul>::data()
Line
Count
Source
60
47.1k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
47.1k
    return reinterpret_cast<T *>(aligned_char);
68
47.1k
#endif
69
47.1k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRFunction::Parameter, 8ul>::data()
Line
Count
Source
60
8.16k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
8.16k
    return reinterpret_cast<T *>(aligned_char);
68
8.16k
#endif
69
8.16k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::data()
Line
Count
Source
60
4.37k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
4.37k
    return reinterpret_cast<T *>(aligned_char);
68
4.37k
#endif
69
4.37k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::data()
Line
Count
Source
60
4.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
4.08k
    return reinterpret_cast<T *>(aligned_char);
68
4.08k
#endif
69
4.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.08k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.08k
    return reinterpret_cast<T *>(aligned_char);
68
6.08k
#endif
69
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::data()
Line
Count
Source
60
450k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
450k
    return reinterpret_cast<T *>(aligned_char);
68
450k
#endif
69
450k
  }
spirv_cross::AlignedBuffer<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::data()
Line
Count
Source
60
6.09k
  {
61
#if defined(_MSC_VER) && _MSC_VER < 1900
62
    // MSVC 2013 workarounds, sigh ...
63
    // Only use this workaround on MSVC 2013 due to some confusion around default initialized unions.
64
    // Spec seems to suggest the memory will be zero-initialized, which is *not* what we want.
65
    return reinterpret_cast<T *>(u.aligned_char);
66
#else
67
6.09k
    return reinterpret_cast<T *>(aligned_char);
68
6.09k
#endif
69
6.09k
  }
70
71
private:
72
#if defined(_MSC_VER) && _MSC_VER < 1900
73
  // MSVC 2013 workarounds, sigh ...
74
  union
75
  {
76
    char aligned_char[sizeof(T) * N];
77
    double dummy_aligner;
78
  } u;
79
#else
80
  alignas(T) char aligned_char[sizeof(T) * N];
81
#endif
82
};
83
84
template <typename T>
85
class AlignedBuffer<T, 0>
86
{
87
public:
88
  T *data()
89
128k
  {
90
128k
    return nullptr;
91
128k
  }
spirv_cross::AlignedBuffer<spirv_cross::Meta::Decoration, 0ul>::data()
Line
Count
Source
89
29.2k
  {
90
29.2k
    return nullptr;
91
29.2k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRUndef*, 0ul>::data()
Line
Count
Source
89
6.14k
  {
90
6.14k
    return nullptr;
91
6.14k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRString*, 0ul>::data()
Line
Count
Source
89
6.23k
  {
90
6.23k
    return nullptr;
91
6.23k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRDebugLocalVariable*, 0ul>::data()
Line
Count
Source
89
6.10k
  {
90
6.10k
    return nullptr;
91
6.10k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRCombinedImageSampler*, 0ul>::data()
Line
Count
Source
89
6.08k
  {
90
6.08k
    return nullptr;
91
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRConstantOp*, 0ul>::data()
Line
Count
Source
89
6.12k
  {
90
6.12k
    return nullptr;
91
6.12k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRType*, 0ul>::data()
Line
Count
Source
89
7.33k
  {
90
7.33k
    return nullptr;
91
7.33k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRExtension*, 0ul>::data()
Line
Count
Source
89
6.65k
  {
90
6.65k
    return nullptr;
91
6.65k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRExpression*, 0ul>::data()
Line
Count
Source
89
6.08k
  {
90
6.08k
    return nullptr;
91
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRFunctionPrototype*, 0ul>::data()
Line
Count
Source
89
6.58k
  {
90
6.58k
    return nullptr;
91
6.58k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRBlock*, 0ul>::data()
Line
Count
Source
89
6.75k
  {
90
6.75k
    return nullptr;
91
6.75k
  }
spirv_cross::AlignedBuffer<std::__1::function<void ()>, 0ul>::data()
Line
Count
Source
89
8.16k
  {
90
8.16k
    return nullptr;
91
8.16k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRFunction*, 0ul>::data()
Line
Count
Source
89
6.61k
  {
90
6.61k
    return nullptr;
91
6.61k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRAccessChain*, 0ul>::data()
Line
Count
Source
89
6.08k
  {
90
6.08k
    return nullptr;
91
6.08k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRVariable*, 0ul>::data()
Line
Count
Source
89
6.72k
  {
90
6.72k
    return nullptr;
91
6.72k
  }
spirv_cross::AlignedBuffer<spirv_cross::SPIRConstant*, 0ul>::data()
Line
Count
Source
89
7.15k
  {
90
7.15k
    return nullptr;
91
7.15k
  }
92
};
93
94
// An immutable version of SmallVector which erases type information about storage.
95
template <typename T>
96
class VectorView
97
{
98
public:
99
  T &operator[](size_t i) SPIRV_CROSS_NOEXCEPT
100
56.9M
  {
101
56.9M
    return ptr[i];
102
56.9M
  }
spirv_cross::VectorView<spirv_cross::Variant>::operator[](unsigned long)
Line
Count
Source
100
1.29M
  {
101
1.29M
    return ptr[i];
102
1.29M
  }
spirv_cross::VectorView<unsigned char>::operator[](unsigned long)
Line
Count
Source
100
8.46k
  {
101
8.46k
    return ptr[i];
102
8.46k
  }
spirv_cross::VectorView<spirv_cross::Meta::Decoration>::operator[](unsigned long)
Line
Count
Source
100
21.8k
  {
101
21.8k
    return ptr[i];
102
21.8k
  }
spirv_cross::VectorView<unsigned int>::operator[](unsigned long)
Line
Count
Source
100
55.5M
  {
101
55.5M
    return ptr[i];
102
55.5M
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)1> >::operator[](unsigned long)
Line
Count
Source
100
6.36k
  {
101
6.36k
    return ptr[i];
102
6.36k
  }
103
104
  const T &operator[](size_t i) const SPIRV_CROSS_NOEXCEPT
105
4.45k
  {
106
4.45k
    return ptr[i];
107
4.45k
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)1> >::operator[](unsigned long) const
Line
Count
Source
105
2.22k
  {
106
2.22k
    return ptr[i];
107
2.22k
  }
spirv_cross::VectorView<spirv_cross::Variant>::operator[](unsigned long) const
Line
Count
Source
105
2.22k
  {
106
2.22k
    return ptr[i];
107
2.22k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::Meta::Decoration>::operator[](unsigned long) const
108
109
  bool empty() const SPIRV_CROSS_NOEXCEPT
110
800k
  {
111
800k
    return buffer_size == 0;
112
800k
  }
spirv_cross::VectorView<spirv_cross::SPIRUndef*>::empty() const
Line
Count
Source
110
284
  {
111
284
    return buffer_size == 0;
112
284
  }
spirv_cross::VectorView<spirv_cross::SPIRString*>::empty() const
Line
Count
Source
110
2.28k
  {
111
2.28k
    return buffer_size == 0;
112
2.28k
  }
spirv_cross::VectorView<spirv_cross::SPIRDebugLocalVariable*>::empty() const
Line
Count
Source
110
194
  {
111
194
    return buffer_size == 0;
112
194
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRCombinedImageSampler*>::empty() const
spirv_cross::VectorView<spirv_cross::SPIRConstantOp*>::empty() const
Line
Count
Source
110
832
  {
111
832
    return buffer_size == 0;
112
832
  }
spirv_cross::VectorView<spirv_cross::SPIRType*>::empty() const
Line
Count
Source
110
30.1k
  {
111
30.1k
    return buffer_size == 0;
112
30.1k
  }
spirv_cross::VectorView<spirv_cross::SPIRExtension*>::empty() const
Line
Count
Source
110
2.99k
  {
111
2.99k
    return buffer_size == 0;
112
2.99k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRExpression*>::empty() const
spirv_cross::VectorView<spirv_cross::SPIRFunctionPrototype*>::empty() const
Line
Count
Source
110
3.65k
  {
111
3.65k
    return buffer_size == 0;
112
3.65k
  }
spirv_cross::VectorView<spirv_cross::SPIRBlock*>::empty() const
Line
Count
Source
110
23.5k
  {
111
23.5k
    return buffer_size == 0;
112
23.5k
  }
spirv_cross::VectorView<spirv_cross::SPIRFunction*>::empty() const
Line
Count
Source
110
4.08k
  {
111
4.08k
    return buffer_size == 0;
112
4.08k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRAccessChain*>::empty() const
spirv_cross::VectorView<spirv_cross::SPIRVariable*>::empty() const
Line
Count
Source
110
10.0k
  {
111
10.0k
    return buffer_size == 0;
112
10.0k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)3> >::empty() const
spirv_cross::VectorView<spirv_cross::SPIRConstant*>::empty() const
Line
Count
Source
110
416k
  {
111
416k
    return buffer_size == 0;
112
416k
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)4> >::empty() const
Line
Count
Source
110
1.55k
  {
111
1.55k
    return buffer_size == 0;
112
1.55k
  }
spirv_cross::VectorView<unsigned int>::empty() const
Line
Count
Source
110
201k
  {
111
201k
    return buffer_size == 0;
112
201k
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)1> >::empty() const
Line
Count
Source
110
103k
  {
111
103k
    return buffer_size == 0;
112
103k
  }
113
114
  size_t size() const SPIRV_CROSS_NOEXCEPT
115
841M
  {
116
841M
    return buffer_size;
117
841M
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter> >::size() const
Line
Count
Source
115
62
  {
116
62
    return buffer_size;
117
62
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter> >::size() const
Line
Count
Source
115
152
  {
116
152
    return buffer_size;
117
152
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter> >::size() const
Line
Count
Source
115
24
  {
116
24
    return buffer_size;
117
24
  }
Unexecuted instantiation: spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter> >::size() const
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter> >::size() const
Line
Count
Source
115
40
  {
116
40
    return buffer_size;
117
40
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter> >::size() const
Line
Count
Source
115
1.18k
  {
116
1.18k
    return buffer_size;
117
1.18k
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter> >::size() const
Line
Count
Source
115
577
  {
116
577
    return buffer_size;
117
577
  }
Unexecuted instantiation: spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter> >::size() const
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter> >::size() const
Line
Count
Source
115
507
  {
116
507
    return buffer_size;
117
507
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter> >::size() const
Line
Count
Source
115
610
  {
116
610
    return buffer_size;
117
610
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter> >::size() const
Line
Count
Source
115
539
  {
116
539
    return buffer_size;
117
539
  }
Unexecuted instantiation: spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter> >::size() const
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter> >::size() const
Line
Count
Source
115
592
  {
116
592
    return buffer_size;
117
592
  }
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter> >::size() const
Line
Count
Source
115
935
  {
116
935
    return buffer_size;
117
935
  }
spirv_cross::VectorView<unsigned int>::size() const
Line
Count
Source
115
103k
  {
116
103k
    return buffer_size;
117
103k
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)1> >::size() const
Line
Count
Source
115
22.2k
  {
116
22.2k
    return buffer_size;
117
22.2k
  }
spirv_cross::VectorView<spirv_cross::Variant>::size() const
Line
Count
Source
115
841M
  {
116
841M
    return buffer_size;
117
841M
  }
spirv_cross::VectorView<spirv_cross::Meta::Decoration>::size() const
Line
Count
Source
115
21.8k
  {
116
21.8k
    return buffer_size;
117
21.8k
  }
118
119
  T *data() SPIRV_CROSS_NOEXCEPT
120
96.7k
  {
121
96.7k
    return ptr;
122
96.7k
  }
123
124
  const T *data() const SPIRV_CROSS_NOEXCEPT
125
0
  {
126
0
    return ptr;
127
0
  }
128
129
  T *begin() SPIRV_CROSS_NOEXCEPT
130
45.5k
  {
131
45.5k
    return ptr;
132
45.5k
  }
spirv_cross::VectorView<unsigned int>::begin()
Line
Count
Source
130
37.8k
  {
131
37.8k
    return ptr;
132
37.8k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::StringStream<4096ul, 4096ul>::Buffer>::begin()
spirv_cross::VectorView<spirv_cross::Instruction>::begin()
Line
Count
Source
130
2.97k
  {
131
2.97k
    return ptr;
132
2.97k
  }
spirv_cross::VectorView<std::__1::pair<unsigned int, unsigned int> >::begin()
Line
Count
Source
130
2.25k
  {
131
2.25k
    return ptr;
132
2.25k
  }
spirv_cross::VectorView<spirv_cross::ParsedIR::Source::Marker>::begin()
Line
Count
Source
130
2.13k
  {
131
2.13k
    return ptr;
132
2.13k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::Meta::Decoration>::begin()
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)3> >::begin()
Line
Count
Source
130
239
  {
131
239
    return ptr;
132
239
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)0> >::begin()
Line
Count
Source
130
124
  {
131
124
    return ptr;
132
124
  }
133
134
  T *end() SPIRV_CROSS_NOEXCEPT
135
45.6k
  {
136
45.6k
    return ptr + buffer_size;
137
45.6k
  }
spirv_cross::VectorView<unsigned int>::end()
Line
Count
Source
135
37.8k
  {
136
37.8k
    return ptr + buffer_size;
137
37.8k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::StringStream<4096ul, 4096ul>::Buffer>::end()
spirv_cross::VectorView<spirv_cross::Instruction>::end()
Line
Count
Source
135
2.97k
  {
136
2.97k
    return ptr + buffer_size;
137
2.97k
  }
spirv_cross::VectorView<std::__1::pair<unsigned int, unsigned int> >::end()
Line
Count
Source
135
2.25k
  {
136
2.25k
    return ptr + buffer_size;
137
2.25k
  }
spirv_cross::VectorView<spirv_cross::ParsedIR::Source::Marker>::end()
Line
Count
Source
135
2.13k
  {
136
2.13k
    return ptr + buffer_size;
137
2.13k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::Meta::Decoration>::end()
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)3> >::end()
Line
Count
Source
135
239
  {
136
239
    return ptr + buffer_size;
137
239
  }
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)0> >::end()
Line
Count
Source
135
186
  {
136
186
    return ptr + buffer_size;
137
186
  }
138
139
  const T *begin() const SPIRV_CROSS_NOEXCEPT
140
0
  {
141
0
    return ptr;
142
0
  }
Unexecuted instantiation: spirv_cross::VectorView<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::begin() const
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::StringStream<4096ul, 4096ul>::Buffer>::begin() const
143
144
  const T *end() const SPIRV_CROSS_NOEXCEPT
145
0
  {
146
0
    return ptr + buffer_size;
147
0
  }
Unexecuted instantiation: spirv_cross::VectorView<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::end() const
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::StringStream<4096ul, 4096ul>::Buffer>::end() const
148
149
  T &front() SPIRV_CROSS_NOEXCEPT
150
0
  {
151
0
    return ptr[0];
152
0
  }
153
154
  const T &front() const SPIRV_CROSS_NOEXCEPT
155
  {
156
    return ptr[0];
157
  }
158
159
  T &back() SPIRV_CROSS_NOEXCEPT
160
436k
  {
161
436k
    return ptr[buffer_size - 1];
162
436k
  }
spirv_cross::VectorView<spirv_cross::SPIRUndef*>::back()
Line
Count
Source
160
142
  {
161
142
    return ptr[buffer_size - 1];
162
142
  }
spirv_cross::VectorView<spirv_cross::SPIRString*>::back()
Line
Count
Source
160
1.14k
  {
161
1.14k
    return ptr[buffer_size - 1];
162
1.14k
  }
spirv_cross::VectorView<spirv_cross::SPIRDebugLocalVariable*>::back()
Line
Count
Source
160
97
  {
161
97
    return ptr[buffer_size - 1];
162
97
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRCombinedImageSampler*>::back()
spirv_cross::VectorView<spirv_cross::SPIRConstantOp*>::back()
Line
Count
Source
160
416
  {
161
416
    return ptr[buffer_size - 1];
162
416
  }
spirv_cross::VectorView<spirv_cross::SPIRType*>::back()
Line
Count
Source
160
15.0k
  {
161
15.0k
    return ptr[buffer_size - 1];
162
15.0k
  }
spirv_cross::VectorView<spirv_cross::SPIRExtension*>::back()
Line
Count
Source
160
1.49k
  {
161
1.49k
    return ptr[buffer_size - 1];
162
1.49k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRExpression*>::back()
spirv_cross::VectorView<spirv_cross::SPIRFunctionPrototype*>::back()
Line
Count
Source
160
1.82k
  {
161
1.82k
    return ptr[buffer_size - 1];
162
1.82k
  }
spirv_cross::VectorView<spirv_cross::SPIRBlock*>::back()
Line
Count
Source
160
11.7k
  {
161
11.7k
    return ptr[buffer_size - 1];
162
11.7k
  }
spirv_cross::VectorView<spirv_cross::SPIRFunction*>::back()
Line
Count
Source
160
2.04k
  {
161
2.04k
    return ptr[buffer_size - 1];
162
2.04k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::SPIRAccessChain*>::back()
spirv_cross::VectorView<spirv_cross::SPIRVariable*>::back()
Line
Count
Source
160
5.03k
  {
161
5.03k
    return ptr[buffer_size - 1];
162
5.03k
  }
spirv_cross::VectorView<spirv_cross::SPIRConstant*>::back()
Line
Count
Source
160
208k
  {
161
208k
    return ptr[buffer_size - 1];
162
208k
  }
spirv_cross::VectorView<spirv_cross::ParsedIR::Source::Marker>::back()
Line
Count
Source
160
1.61k
  {
161
1.61k
    return ptr[buffer_size - 1];
162
1.61k
  }
Unexecuted instantiation: spirv_cross::VectorView<spirv_cross::Variant>::back()
spirv_cross::VectorView<bool>::back()
Line
Count
Source
160
93.7k
  {
161
93.7k
    return ptr[buffer_size - 1];
162
93.7k
  }
spirv_cross::VectorView<unsigned int>::back()
Line
Count
Source
160
93.7k
  {
161
93.7k
    return ptr[buffer_size - 1];
162
93.7k
  }
163
164
  const T &back() const SPIRV_CROSS_NOEXCEPT
165
0
  {
166
0
    return ptr[buffer_size - 1];
167
0
  }
168
169
  // Makes it easier to consume SmallVector.
170
#if defined(_MSC_VER) && _MSC_VER < 1900
171
  explicit operator std::vector<T>() const
172
  {
173
    // Another MSVC 2013 workaround. It does not understand lvalue/rvalue qualified operations.
174
    return std::vector<T>(ptr, ptr + buffer_size);
175
  }
176
#else
177
  // Makes it easier to consume SmallVector.
178
  explicit operator std::vector<T>() const &
179
  {
180
    return std::vector<T>(ptr, ptr + buffer_size);
181
  }
182
183
  // If we are converting as an r-value, we can pilfer our elements.
184
  explicit operator std::vector<T>() &&
185
  {
186
    return std::vector<T>(std::make_move_iterator(ptr), std::make_move_iterator(ptr + buffer_size));
187
  }
188
#endif
189
190
  // Avoid sliced copies. Base class should only be read as a reference.
191
  VectorView(const VectorView &) = delete;
192
  void operator=(const VectorView &) = delete;
193
194
protected:
195
754k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)2> >::VectorView()
Line
Count
Source
195
46.1k
  VectorView() = default;
spirv_cross::VectorView<unsigned int>::VectorView()
Line
Count
Source
195
157k
  VectorView() = default;
spirv_cross::VectorView<bool>::VectorView()
Line
Count
Source
195
26.8k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)1> >::VectorView()
Line
Count
Source
195
15.0k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)3> >::VectorView()
Line
Count
Source
195
225k
  VectorView() = default;
spirv_cross::VectorView<std::__1::pair<unsigned int, unsigned int> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::Instruction>::VectorView()
Line
Count
Source
195
14.7k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::ParsedIR::Source::Marker>::VectorView()
Line
Count
Source
195
5.35k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::Meta::Decoration>::VectorView()
Line
Count
Source
195
13.8k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)0> >::VectorView()
Line
Count
Source
195
75.5k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRFunction::Parameter>::VectorView()
Line
Count
Source
195
4.08k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)6> >::VectorView()
Line
Count
Source
195
2.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRFunction::CombinedImageSamplerParameter>::VectorView()
Line
Count
Source
195
2.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::function<void ()> >::VectorView()
Line
Count
Source
195
4.08k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRBlock::Phi>::VectorView()
Line
Count
Source
195
11.7k
  VectorView() = default;
spirv_cross::VectorView<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> > >::VectorView()
Line
Count
Source
195
23.5k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRBlock::Case>::VectorView()
Line
Count
Source
195
23.5k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::Variant>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spv::Capability>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<unsigned char>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::TypedID<(spirv_cross::Types)4> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRType*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRVariable*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRConstant*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRFunction*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRFunctionPrototype*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRBlock*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRExtension*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRExpression*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRConstantOp*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRCombinedImageSampler*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRAccessChain*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRUndef*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRString*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<spirv_cross::SPIRDebugLocalVariable*>::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
spirv_cross::VectorView<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter> >::VectorView()
Line
Count
Source
195
3.04k
  VectorView() = default;
196
  T *ptr = nullptr;
197
  size_t buffer_size = 0;
198
};
199
200
// Simple vector which supports up to N elements inline, without malloc/free.
201
// We use a lot of throwaway vectors all over the place which triggers allocations.
202
// This class only implements the subset of std::vector we need in SPIRV-Cross.
203
// It is *NOT* a drop-in replacement in general projects.
204
template <typename T, size_t N = 8>
205
class SmallVector : public VectorView<T>
206
{
207
public:
208
  SmallVector() SPIRV_CROSS_NOEXCEPT
209
754k
  {
210
754k
    this->ptr = stack_storage.data();
211
754k
    buffer_capacity = N;
212
754k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::SmallVector()
Line
Count
Source
209
46.1k
  {
210
46.1k
    this->ptr = stack_storage.data();
211
46.1k
    buffer_capacity = N;
212
46.1k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::SmallVector()
Line
Count
Source
209
157k
  {
210
157k
    this->ptr = stack_storage.data();
211
157k
    buffer_capacity = N;
212
157k
  }
spirv_cross::SmallVector<bool, 8ul>::SmallVector()
Line
Count
Source
209
26.8k
  {
210
26.8k
    this->ptr = stack_storage.data();
211
26.8k
    buffer_capacity = N;
212
26.8k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::SmallVector()
Line
Count
Source
209
15.0k
  {
210
15.0k
    this->ptr = stack_storage.data();
211
15.0k
    buffer_capacity = N;
212
15.0k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::SmallVector()
Line
Count
Source
209
225k
  {
210
225k
    this->ptr = stack_storage.data();
211
225k
    buffer_capacity = N;
212
225k
  }
spirv_cross::SmallVector<std::__1::pair<unsigned int, unsigned int>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::SmallVector()
Line
Count
Source
209
14.7k
  {
210
14.7k
    this->ptr = stack_storage.data();
211
14.7k
    buffer_capacity = N;
212
14.7k
  }
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::SmallVector()
Line
Count
Source
209
5.35k
  {
210
5.35k
    this->ptr = stack_storage.data();
211
5.35k
    buffer_capacity = N;
212
5.35k
  }
spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::SmallVector()
Line
Count
Source
209
13.8k
  {
210
13.8k
    this->ptr = stack_storage.data();
211
13.8k
    buffer_capacity = N;
212
13.8k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::SmallVector()
Line
Count
Source
209
75.5k
  {
210
75.5k
    this->ptr = stack_storage.data();
211
75.5k
    buffer_capacity = N;
212
75.5k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::SmallVector()
Line
Count
Source
209
4.08k
  {
210
4.08k
    this->ptr = stack_storage.data();
211
4.08k
    buffer_capacity = N;
212
4.08k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::SmallVector()
Line
Count
Source
209
2.04k
  {
210
2.04k
    this->ptr = stack_storage.data();
211
2.04k
    buffer_capacity = N;
212
2.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::SmallVector()
Line
Count
Source
209
2.04k
  {
210
2.04k
    this->ptr = stack_storage.data();
211
2.04k
    buffer_capacity = N;
212
2.04k
  }
spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::SmallVector()
Line
Count
Source
209
4.08k
  {
210
4.08k
    this->ptr = stack_storage.data();
211
4.08k
    buffer_capacity = N;
212
4.08k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::SmallVector()
Line
Count
Source
209
11.7k
  {
210
11.7k
    this->ptr = stack_storage.data();
211
11.7k
    buffer_capacity = N;
212
11.7k
  }
spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::SmallVector()
Line
Count
Source
209
23.5k
  {
210
23.5k
    this->ptr = stack_storage.data();
211
23.5k
    buffer_capacity = N;
212
23.5k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::SmallVector()
Line
Count
Source
209
23.5k
  {
210
23.5k
    this->ptr = stack_storage.data();
211
23.5k
    buffer_capacity = N;
212
23.5k
  }
spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spv::Capability, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<unsigned char, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::SmallVector()
Line
Count
Source
209
3.04k
  {
210
3.04k
    this->ptr = stack_storage.data();
211
3.04k
    buffer_capacity = N;
212
3.04k
  }
213
214
  template <typename U>
215
  SmallVector(const U *arg_list_begin, const U *arg_list_end) SPIRV_CROSS_NOEXCEPT : SmallVector()
216
  {
217
    auto count = size_t(arg_list_end - arg_list_begin);
218
    reserve(count);
219
    for (size_t i = 0; i < count; i++, arg_list_begin++)
220
      new (&this->ptr[i]) T(*arg_list_begin);
221
    this->buffer_size = count;
222
  }
223
224
  template <typename U>
225
  SmallVector(std::initializer_list<U> init) SPIRV_CROSS_NOEXCEPT : SmallVector(init.begin(), init.end())
226
  {
227
  }
228
229
  template <typename U, size_t M>
230
  explicit SmallVector(const U (&init)[M]) SPIRV_CROSS_NOEXCEPT : SmallVector(init, init + M)
231
  {
232
  }
233
234
15.9k
  SmallVector(SmallVector &&other) SPIRV_CROSS_NOEXCEPT : SmallVector()
235
15.9k
  {
236
15.9k
    *this = std::move(other);
237
15.9k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>&&)
Line
Count
Source
234
12.9k
  SmallVector(SmallVector &&other) SPIRV_CROSS_NOEXCEPT : SmallVector()
235
12.9k
  {
236
12.9k
    *this = std::move(other);
237
12.9k
  }
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>&&)
Line
Count
Source
234
2.94k
  SmallVector(SmallVector &&other) SPIRV_CROSS_NOEXCEPT : SmallVector()
235
2.94k
  {
236
2.94k
    *this = std::move(other);
237
2.94k
  }
238
239
  SmallVector &operator=(SmallVector &&other) SPIRV_CROSS_NOEXCEPT
240
15.9k
  {
241
15.9k
    clear();
242
15.9k
    if (other.ptr != other.stack_storage.data())
243
43
    {
244
      // Pilfer allocated pointer.
245
43
      if (this->ptr != stack_storage.data())
246
0
        free(this->ptr);
247
43
      this->ptr = other.ptr;
248
43
      this->buffer_size = other.buffer_size;
249
43
      buffer_capacity = other.buffer_capacity;
250
43
      other.ptr = nullptr;
251
43
      other.buffer_size = 0;
252
43
      other.buffer_capacity = 0;
253
43
    }
254
15.8k
    else
255
15.8k
    {
256
      // Need to move the stack contents individually.
257
15.8k
      reserve(other.buffer_size);
258
16.1k
      for (size_t i = 0; i < other.buffer_size; i++)
259
234
      {
260
234
        new (&this->ptr[i]) T(std::move(other.ptr[i]));
261
234
        other.ptr[i].~T();
262
234
      }
263
15.8k
      this->buffer_size = other.buffer_size;
264
15.8k
      other.buffer_size = 0;
265
15.8k
    }
266
15.9k
    return *this;
267
15.9k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>&&)
Line
Count
Source
240
12.9k
  {
241
12.9k
    clear();
242
12.9k
    if (other.ptr != other.stack_storage.data())
243
0
    {
244
      // Pilfer allocated pointer.
245
0
      if (this->ptr != stack_storage.data())
246
0
        free(this->ptr);
247
0
      this->ptr = other.ptr;
248
0
      this->buffer_size = other.buffer_size;
249
0
      buffer_capacity = other.buffer_capacity;
250
0
      other.ptr = nullptr;
251
0
      other.buffer_size = 0;
252
0
      other.buffer_capacity = 0;
253
0
    }
254
12.9k
    else
255
12.9k
    {
256
      // Need to move the stack contents individually.
257
12.9k
      reserve(other.buffer_size);
258
12.9k
      for (size_t i = 0; i < other.buffer_size; i++)
259
0
      {
260
0
        new (&this->ptr[i]) T(std::move(other.ptr[i]));
261
0
        other.ptr[i].~T();
262
0
      }
263
12.9k
      this->buffer_size = other.buffer_size;
264
12.9k
      other.buffer_size = 0;
265
12.9k
    }
266
12.9k
    return *this;
267
12.9k
  }
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>&&)
Line
Count
Source
240
2.94k
  {
241
2.94k
    clear();
242
2.94k
    if (other.ptr != other.stack_storage.data())
243
43
    {
244
      // Pilfer allocated pointer.
245
43
      if (this->ptr != stack_storage.data())
246
0
        free(this->ptr);
247
43
      this->ptr = other.ptr;
248
43
      this->buffer_size = other.buffer_size;
249
43
      buffer_capacity = other.buffer_capacity;
250
43
      other.ptr = nullptr;
251
43
      other.buffer_size = 0;
252
43
      other.buffer_capacity = 0;
253
43
    }
254
2.89k
    else
255
2.89k
    {
256
      // Need to move the stack contents individually.
257
2.89k
      reserve(other.buffer_size);
258
3.13k
      for (size_t i = 0; i < other.buffer_size; i++)
259
234
      {
260
234
        new (&this->ptr[i]) T(std::move(other.ptr[i]));
261
234
        other.ptr[i].~T();
262
234
      }
263
2.89k
      this->buffer_size = other.buffer_size;
264
2.89k
      other.buffer_size = 0;
265
2.89k
    }
266
2.94k
    return *this;
267
2.94k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<spv::Capability, 8ul>::operator=(spirv_cross::SmallVector<spv::Capability, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::operator=(spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<unsigned char, 8ul>::operator=(spirv_cross::SmallVector<unsigned char, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::Variant, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<unsigned int, 8ul>::operator=(spirv_cross::SmallVector<unsigned int, 8ul>&&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>&&)
268
269
19.7k
  SmallVector(const SmallVector &other) SPIRV_CROSS_NOEXCEPT : SmallVector()
270
19.7k
  {
271
19.7k
    *this = other;
272
19.7k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::SmallVector(spirv_cross::SmallVector<unsigned int, 8ul> const&)
Line
Count
Source
269
9.89k
  SmallVector(const SmallVector &other) SPIRV_CROSS_NOEXCEPT : SmallVector()
270
9.89k
  {
271
9.89k
    *this = other;
272
9.89k
  }
spirv_cross::SmallVector<bool, 8ul>::SmallVector(spirv_cross::SmallVector<bool, 8ul> const&)
Line
Count
Source
269
4.94k
  SmallVector(const SmallVector &other) SPIRV_CROSS_NOEXCEPT : SmallVector()
270
4.94k
  {
271
4.94k
    *this = other;
272
4.94k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul> const&)
Line
Count
Source
269
4.94k
  SmallVector(const SmallVector &other) SPIRV_CROSS_NOEXCEPT : SmallVector()
270
4.94k
  {
271
4.94k
    *this = other;
272
4.94k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::SmallVector(spirv_cross::SmallVector<std::__1::function<void ()>, 0ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::Instruction, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::SmallVector(spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::SmallVector(spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul> const&)
273
274
  SmallVector &operator=(const SmallVector &other) SPIRV_CROSS_NOEXCEPT
275
33.9k
  {
276
33.9k
    if (this == &other)
277
1.93k
      return *this;
278
279
32.0k
    clear();
280
32.0k
    reserve(other.buffer_size);
281
146k
    for (size_t i = 0; i < other.buffer_size; i++)
282
114k
      new (&this->ptr[i]) T(other.ptr[i]);
283
32.0k
    this->buffer_size = other.buffer_size;
284
32.0k
    return *this;
285
33.9k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::operator=(spirv_cross::SmallVector<unsigned int, 8ul> const&)
Line
Count
Source
275
15.9k
  {
276
15.9k
    if (this == &other)
277
440
      return *this;
278
279
15.5k
    clear();
280
15.5k
    reserve(other.buffer_size);
281
70.8k
    for (size_t i = 0; i < other.buffer_size; i++)
282
55.3k
      new (&this->ptr[i]) T(other.ptr[i]);
283
15.5k
    this->buffer_size = other.buffer_size;
284
15.5k
    return *this;
285
15.9k
  }
spirv_cross::SmallVector<bool, 8ul>::operator=(spirv_cross::SmallVector<bool, 8ul> const&)
Line
Count
Source
275
7.97k
  {
276
7.97k
    if (this == &other)
277
220
      return *this;
278
279
7.75k
    clear();
280
7.75k
    reserve(other.buffer_size);
281
63.1k
    for (size_t i = 0; i < other.buffer_size; i++)
282
55.3k
      new (&this->ptr[i]) T(other.ptr[i]);
283
7.75k
    this->buffer_size = other.buffer_size;
284
7.75k
    return *this;
285
7.97k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul> const&)
Line
Count
Source
275
10.0k
  {
276
10.0k
    if (this == &other)
277
1.27k
      return *this;
278
279
8.76k
    clear();
280
8.76k
    reserve(other.buffer_size);
281
12.9k
    for (size_t i = 0; i < other.buffer_size; i++)
282
4.19k
      new (&this->ptr[i]) T(other.ptr[i]);
283
8.76k
    this->buffer_size = other.buffer_size;
284
8.76k
    return *this;
285
10.0k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::Instruction, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::operator=(spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::operator=(spirv_cross::SmallVector<std::__1::function<void ()>, 0ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::operator=(spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spv::Capability, 8ul>::operator=(spirv_cross::SmallVector<spv::Capability, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::operator=(spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<unsigned char, 8ul>::operator=(spirv_cross::SmallVector<unsigned char, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul> const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::operator=(spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul> const&)
286
287
96.8k
  explicit SmallVector(size_t count) SPIRV_CROSS_NOEXCEPT : SmallVector()
288
96.8k
  {
289
96.8k
    resize(count);
290
96.8k
  }
291
292
  ~SmallVector()
293
754k
  {
294
754k
    clear();
295
754k
    if (this->ptr != stack_storage.data())
296
21.6k
      free(this->ptr);
297
754k
  }
spirv_cross::SmallVector<std::__1::pair<unsigned int, unsigned int>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
34
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::~SmallVector()
Line
Count
Source
293
157k
  {
294
157k
    clear();
295
157k
    if (this->ptr != stack_storage.data())
296
4.63k
      free(this->ptr);
297
157k
  }
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::~SmallVector()
Line
Count
Source
293
5.35k
  {
294
5.35k
    clear();
295
5.35k
    if (this->ptr != stack_storage.data())
296
81
      free(this->ptr);
297
5.35k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::~SmallVector()
Line
Count
Source
293
46.1k
  {
294
46.1k
    clear();
295
46.1k
    if (this->ptr != stack_storage.data())
296
185
      free(this->ptr);
297
46.1k
  }
spirv_cross::SmallVector<unsigned char, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
2.74k
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
22
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spv::Capability, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
24
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::~SmallVector()
Line
Count
Source
293
75.5k
  {
294
75.5k
    clear();
295
75.5k
    if (this->ptr != stack_storage.data())
296
1.24k
      free(this->ptr);
297
75.5k
  }
spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::~SmallVector()
Line
Count
Source
293
13.8k
  {
294
13.8k
    clear();
295
13.8k
    if (this->ptr != stack_storage.data())
296
1.38k
      free(this->ptr);
297
13.8k
  }
spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
2.74k
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::~SmallVector()
Line
Count
Source
293
15.0k
  {
294
15.0k
    clear();
295
15.0k
    if (this->ptr != stack_storage.data())
296
286
      free(this->ptr);
297
15.0k
  }
spirv_cross::SmallVector<bool, 8ul>::~SmallVector()
Line
Count
Source
293
26.8k
  {
294
26.8k
    clear();
295
26.8k
    if (this->ptr != stack_storage.data())
296
1.17k
      free(this->ptr);
297
26.8k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::~SmallVector()
Line
Count
Source
293
225k
  {
294
225k
    clear();
295
225k
    if (this->ptr != stack_storage.data())
296
67
      free(this->ptr);
297
225k
  }
spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::~SmallVector()
Line
Count
Source
293
14.7k
  {
294
14.7k
    clear();
295
14.7k
    if (this->ptr != stack_storage.data())
296
2.06k
      free(this->ptr);
297
14.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::~SmallVector()
Line
Count
Source
293
4.08k
  {
294
4.08k
    clear();
295
4.08k
    if (this->ptr != stack_storage.data())
296
1
      free(this->ptr);
297
4.08k
  }
spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::~SmallVector()
Line
Count
Source
293
4.08k
  {
294
4.08k
    clear();
295
4.08k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
4.08k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::~SmallVector()
Line
Count
Source
293
2.04k
  {
294
2.04k
    clear();
295
2.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
2.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::~SmallVector()
Line
Count
Source
293
2.04k
  {
294
2.04k
    clear();
295
2.04k
    if (this->ptr != stack_storage.data())
296
157
      free(this->ptr);
297
2.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::~SmallVector()
Line
Count
Source
293
23.5k
  {
294
23.5k
    clear();
295
23.5k
    if (this->ptr != stack_storage.data())
296
92
      free(this->ptr);
297
23.5k
  }
spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::~SmallVector()
Line
Count
Source
293
23.5k
  {
294
23.5k
    clear();
295
23.5k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
23.5k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::~SmallVector()
Line
Count
Source
293
11.7k
  {
294
11.7k
    clear();
295
11.7k
    if (this->ptr != stack_storage.data())
296
53
      free(this->ptr);
297
11.7k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
1.10k
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
533
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
12
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
617
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
539
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
507
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
529
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
577
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
40
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
62
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
152
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
0
      free(this->ptr);
297
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::~SmallVector()
Line
Count
Source
293
3.04k
  {
294
3.04k
    clear();
295
3.04k
    if (this->ptr != stack_storage.data())
296
24
      free(this->ptr);
297
3.04k
  }
298
299
  void clear() SPIRV_CROSS_NOEXCEPT
300
804k
  {
301
1.95G
    for (size_t i = 0; i < this->buffer_size; i++)
302
1.95G
      this->ptr[i].~T();
303
804k
    this->buffer_size = 0;
304
804k
  }
spirv_cross::SmallVector<std::__1::pair<unsigned int, unsigned int>, 8ul>::clear()
Line
Count
Source
300
5.29k
  {
301
7.39k
    for (size_t i = 0; i < this->buffer_size; i++)
302
2.09k
      this->ptr[i].~T();
303
5.29k
    this->buffer_size = 0;
304
5.29k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::clear()
Line
Count
Source
300
173k
  {
301
55.8M
    for (size_t i = 0; i < this->buffer_size; i++)
302
55.7M
      this->ptr[i].~T();
303
173k
    this->buffer_size = 0;
304
173k
  }
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::clear()
Line
Count
Source
300
8.29k
  {
301
9.91k
    for (size_t i = 0; i < this->buffer_size; i++)
302
1.61k
      this->ptr[i].~T();
303
8.29k
    this->buffer_size = 0;
304
8.29k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::clear()
Line
Count
Source
300
59.1k
  {
301
69.3k
    for (size_t i = 0; i < this->buffer_size; i++)
302
10.2k
      this->ptr[i].~T();
303
59.1k
    this->buffer_size = 0;
304
59.1k
  }
spirv_cross::SmallVector<unsigned char, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
840M
    for (size_t i = 0; i < this->buffer_size; i++)
302
840M
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
6.85k
    for (size_t i = 0; i < this->buffer_size; i++)
302
3.81k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spv::Capability, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
9.33k
    for (size_t i = 0; i < this->buffer_size; i++)
302
6.29k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::clear()
Line
Count
Source
300
75.5k
  {
301
412k
    for (size_t i = 0; i < this->buffer_size; i++)
302
336k
      this->ptr[i].~T();
303
75.5k
    this->buffer_size = 0;
304
75.5k
  }
spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::clear()
Line
Count
Source
300
13.8k
  {
301
160M
    for (size_t i = 0; i < this->buffer_size; i++)
302
160M
      this->ptr[i].~T();
303
13.8k
    this->buffer_size = 0;
304
13.8k
  }
spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
840M
    for (size_t i = 0; i < this->buffer_size; i++)
302
840M
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::StringStream<4096ul, 4096ul>::Buffer, 8ul>::clear()
spirv_cross::SmallVector<bool, 8ul>::clear()
Line
Count
Source
300
34.5k
  {
301
93.9k
    for (size_t i = 0; i < this->buffer_size; i++)
302
59.4k
      this->ptr[i].~T();
303
34.5k
    this->buffer_size = 0;
304
34.5k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::clear()
Line
Count
Source
300
23.8k
  {
301
33.5k
    for (size_t i = 0; i < this->buffer_size; i++)
302
9.71k
      this->ptr[i].~T();
303
23.8k
    this->buffer_size = 0;
304
23.8k
  }
spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::clear()
Line
Count
Source
300
14.7k
  {
301
367k
    for (size_t i = 0; i < this->buffer_size; i++)
302
353k
      this->ptr[i].~T();
303
14.7k
    this->buffer_size = 0;
304
14.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::clear()
Line
Count
Source
300
11.7k
  {
301
15.8k
    for (size_t i = 0; i < this->buffer_size; i++)
302
4.04k
      this->ptr[i].~T();
303
11.7k
    this->buffer_size = 0;
304
11.7k
  }
spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::clear()
Line
Count
Source
300
23.5k
  {
301
23.5k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
23.5k
    this->buffer_size = 0;
304
23.5k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::clear()
Line
Count
Source
300
23.5k
  {
301
25.4k
    for (size_t i = 0; i < this->buffer_size; i++)
302
1.90k
      this->ptr[i].~T();
303
23.5k
    this->buffer_size = 0;
304
23.5k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::clear()
Line
Count
Source
300
4.08k
  {
301
4.44k
    for (size_t i = 0; i < this->buffer_size; i++)
302
356
      this->ptr[i].~T();
303
4.08k
    this->buffer_size = 0;
304
4.08k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::clear()
Line
Count
Source
300
2.04k
  {
301
13.8k
    for (size_t i = 0; i < this->buffer_size; i++)
302
11.7k
      this->ptr[i].~T();
303
2.04k
    this->buffer_size = 0;
304
2.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::clear()
Line
Count
Source
300
2.04k
  {
301
2.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
2.04k
    this->buffer_size = 0;
304
2.04k
  }
spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::clear()
Line
Count
Source
300
4.08k
  {
301
4.08k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
4.08k
    this->buffer_size = 0;
304
4.08k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::clear()
Line
Count
Source
300
225k
  {
301
55.8M
    for (size_t i = 0; i < this->buffer_size; i++)
302
55.5M
      this->ptr[i].~T();
303
225k
    this->buffer_size = 0;
304
225k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
4.22k
    for (size_t i = 0; i < this->buffer_size; i++)
302
1.18k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
23.0k
    for (size_t i = 0; i < this->buffer_size; i++)
302
20.0k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.63k
    for (size_t i = 0; i < this->buffer_size; i++)
302
592
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
13.6k
    for (size_t i = 0; i < this->buffer_size; i++)
302
10.6k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.97k
    for (size_t i = 0; i < this->buffer_size; i++)
302
935
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
190k
    for (size_t i = 0; i < this->buffer_size; i++)
302
187k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.57k
    for (size_t i = 0; i < this->buffer_size; i++)
302
539
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
11.6k
    for (size_t i = 0; i < this->buffer_size; i++)
302
8.62k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.54k
    for (size_t i = 0; i < this->buffer_size; i++)
302
507
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
11.1k
    for (size_t i = 0; i < this->buffer_size; i++)
302
8.11k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.65k
    for (size_t i = 0; i < this->buffer_size; i++)
302
610
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
15.2k
    for (size_t i = 0; i < this->buffer_size; i++)
302
12.2k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.61k
    for (size_t i = 0; i < this->buffer_size; i++)
302
577
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
12.2k
    for (size_t i = 0; i < this->buffer_size; i++)
302
9.23k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.08k
    for (size_t i = 0; i < this->buffer_size; i++)
302
40
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.68k
    for (size_t i = 0; i < this->buffer_size; i++)
302
640
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.04k
    for (size_t i = 0; i < this->buffer_size; i++)
302
0
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.10k
    for (size_t i = 0; i < this->buffer_size; i++)
302
62
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
4.03k
    for (size_t i = 0; i < this->buffer_size; i++)
302
992
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.19k
    for (size_t i = 0; i < this->buffer_size; i++)
302
152
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
5.47k
    for (size_t i = 0; i < this->buffer_size; i++)
302
2.43k
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.06k
    for (size_t i = 0; i < this->buffer_size; i++)
302
24
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::clear()
Line
Count
Source
300
3.04k
  {
301
3.42k
    for (size_t i = 0; i < this->buffer_size; i++)
302
384
      this->ptr[i].~T();
303
3.04k
    this->buffer_size = 0;
304
3.04k
  }
305
306
  void push_back(const T &t) SPIRV_CROSS_NOEXCEPT
307
1.01M
  {
308
1.01M
    reserve(this->buffer_size + 1);
309
1.01M
    new (&this->ptr[this->buffer_size]) T(t);
310
1.01M
    this->buffer_size++;
311
1.01M
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::StringStream<4096ul, 4096ul>::Buffer, 8ul>::push_back(spirv_cross::StringStream<4096ul, 4096ul>::Buffer const&)
spirv_cross::SmallVector<unsigned int, 8ul>::push_back(unsigned int const&)
Line
Count
Source
307
70.3k
  {
308
70.3k
    reserve(this->buffer_size + 1);
309
70.3k
    new (&this->ptr[this->buffer_size]) T(t);
310
70.3k
    this->buffer_size++;
311
70.3k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)2> const&)
Line
Count
Source
307
3.30k
  {
308
3.30k
    reserve(this->buffer_size + 1);
309
3.30k
    new (&this->ptr[this->buffer_size]) T(t);
310
3.30k
    this->buffer_size++;
311
3.30k
  }
spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::push_back(spirv_cross::Instruction const&)
Line
Count
Source
307
353k
  {
308
353k
    reserve(this->buffer_size + 1);
309
353k
    new (&this->ptr[this->buffer_size]) T(t);
310
353k
    this->buffer_size++;
311
353k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)0> const&)
Line
Count
Source
307
336k
  {
308
336k
    reserve(this->buffer_size + 1);
309
336k
    new (&this->ptr[this->buffer_size]) T(t);
310
336k
    this->buffer_size++;
311
336k
  }
spirv_cross::SmallVector<bool, 8ul>::push_back(bool const&)
Line
Count
Source
307
1.06k
  {
308
1.06k
    reserve(this->buffer_size + 1);
309
1.06k
    new (&this->ptr[this->buffer_size]) T(t);
310
1.06k
    this->buffer_size++;
311
1.06k
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::push_back(spirv_cross::SPIRType* const&)
Line
Count
Source
307
15.0k
  {
308
15.0k
    reserve(this->buffer_size + 1);
309
15.0k
    new (&this->ptr[this->buffer_size]) T(t);
310
15.0k
    this->buffer_size++;
311
15.0k
  }
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::push_back(spirv_cross::SPIRVariable* const&)
Line
Count
Source
307
5.03k
  {
308
5.03k
    reserve(this->buffer_size + 1);
309
5.03k
    new (&this->ptr[this->buffer_size]) T(t);
310
5.03k
    this->buffer_size++;
311
5.03k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::push_back(spirv_cross::SPIRConstant* const&)
Line
Count
Source
307
208k
  {
308
208k
    reserve(this->buffer_size + 1);
309
208k
    new (&this->ptr[this->buffer_size]) T(t);
310
208k
    this->buffer_size++;
311
208k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::push_back(spirv_cross::SPIRFunction* const&)
Line
Count
Source
307
2.04k
  {
308
2.04k
    reserve(this->buffer_size + 1);
309
2.04k
    new (&this->ptr[this->buffer_size]) T(t);
310
2.04k
    this->buffer_size++;
311
2.04k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::push_back(spirv_cross::SPIRFunctionPrototype* const&)
Line
Count
Source
307
1.82k
  {
308
1.82k
    reserve(this->buffer_size + 1);
309
1.82k
    new (&this->ptr[this->buffer_size]) T(t);
310
1.82k
    this->buffer_size++;
311
1.82k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::push_back(spirv_cross::SPIRBlock* const&)
Line
Count
Source
307
11.7k
  {
308
11.7k
    reserve(this->buffer_size + 1);
309
11.7k
    new (&this->ptr[this->buffer_size]) T(t);
310
11.7k
    this->buffer_size++;
311
11.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::push_back(spirv_cross::SPIRExtension* const&)
Line
Count
Source
307
1.49k
  {
308
1.49k
    reserve(this->buffer_size + 1);
309
1.49k
    new (&this->ptr[this->buffer_size]) T(t);
310
1.49k
    this->buffer_size++;
311
1.49k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::push_back(spirv_cross::SPIRExpression* const&)
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::push_back(spirv_cross::SPIRConstantOp* const&)
Line
Count
Source
307
416
  {
308
416
    reserve(this->buffer_size + 1);
309
416
    new (&this->ptr[this->buffer_size]) T(t);
310
416
    this->buffer_size++;
311
416
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::push_back(spirv_cross::SPIRCombinedImageSampler* const&)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::push_back(spirv_cross::SPIRAccessChain* const&)
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::push_back(spirv_cross::SPIRUndef* const&)
Line
Count
Source
307
142
  {
308
142
    reserve(this->buffer_size + 1);
309
142
    new (&this->ptr[this->buffer_size]) T(t);
310
142
    this->buffer_size++;
311
142
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::push_back(spirv_cross::SPIRString* const&)
Line
Count
Source
307
1.14k
  {
308
1.14k
    reserve(this->buffer_size + 1);
309
1.14k
    new (&this->ptr[this->buffer_size]) T(t);
310
1.14k
    this->buffer_size++;
311
1.14k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::push_back(spirv_cross::SPIRDebugLocalVariable* const&)
Line
Count
Source
307
97
  {
308
97
    reserve(this->buffer_size + 1);
309
97
    new (&this->ptr[this->buffer_size]) T(t);
310
97
    this->buffer_size++;
311
97
  }
312
313
  void push_back(T &&t) SPIRV_CROSS_NOEXCEPT
314
55.8M
  {
315
55.8M
    reserve(this->buffer_size + 1);
316
55.8M
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
55.8M
    this->buffer_size++;
318
55.8M
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::push_back(spirv_cross::SPIRUndef*&&)
Line
Count
Source
314
992
  {
315
992
    reserve(this->buffer_size + 1);
316
992
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
992
    this->buffer_size++;
318
992
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::push_back(spirv_cross::SPIRString*&&)
Line
Count
Source
314
2.43k
  {
315
2.43k
    reserve(this->buffer_size + 1);
316
2.43k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
2.43k
    this->buffer_size++;
318
2.43k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::push_back(spirv_cross::SPIRDebugLocalVariable*&&)
Line
Count
Source
314
384
  {
315
384
    reserve(this->buffer_size + 1);
316
384
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
384
    this->buffer_size++;
318
384
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::push_back(spirv_cross::SPIRCombinedImageSampler*&&)
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::push_back(spirv_cross::SPIRConstantOp*&&)
Line
Count
Source
314
640
  {
315
640
    reserve(this->buffer_size + 1);
316
640
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
640
    this->buffer_size++;
318
640
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::push_back(spirv_cross::SPIRType*&&)
Line
Count
Source
314
20.0k
  {
315
20.0k
    reserve(this->buffer_size + 1);
316
20.0k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
20.0k
    this->buffer_size++;
318
20.0k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::push_back(spirv_cross::SPIRExtension*&&)
Line
Count
Source
314
9.23k
  {
315
9.23k
    reserve(this->buffer_size + 1);
316
9.23k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
9.23k
    this->buffer_size++;
318
9.23k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::push_back(spirv_cross::SPIRExpression*&&)
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::push_back(spirv_cross::SPIRFunctionPrototype*&&)
Line
Count
Source
314
8.11k
  {
315
8.11k
    reserve(this->buffer_size + 1);
316
8.11k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
8.11k
    this->buffer_size++;
318
8.11k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::push_back(spirv_cross::SPIRBlock*&&)
Line
Count
Source
314
12.2k
  {
315
12.2k
    reserve(this->buffer_size + 1);
316
12.2k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
12.2k
    this->buffer_size++;
318
12.2k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::push_back(spirv_cross::SPIRFunction::Parameter&&)
Line
Count
Source
314
356
  {
315
356
    reserve(this->buffer_size + 1);
316
356
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
356
    this->buffer_size++;
318
356
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::push_back(spirv_cross::SPIRFunction*&&)
Line
Count
Source
314
8.62k
  {
315
8.62k
    reserve(this->buffer_size + 1);
316
8.62k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
8.62k
    this->buffer_size++;
318
8.62k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::push_back(spirv_cross::SPIRAccessChain*&&)
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::push_back(spirv_cross::SPIRVariable*&&)
Line
Count
Source
314
10.6k
  {
315
10.6k
    reserve(this->buffer_size + 1);
316
10.6k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
10.6k
    this->buffer_size++;
318
10.6k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)3>&&)
Line
Count
Source
314
55.5M
  {
315
55.5M
    reserve(this->buffer_size + 1);
316
55.5M
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
55.5M
    this->buffer_size++;
318
55.5M
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::push_back(spirv_cross::SPIRConstant*&&)
Line
Count
Source
314
187k
  {
315
187k
    reserve(this->buffer_size + 1);
316
187k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
187k
    this->buffer_size++;
318
187k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)4>&&)
spirv_cross::SmallVector<spv::Capability, 8ul>::push_back(spv::Capability&&)
Line
Count
Source
314
6.29k
  {
315
6.29k
    reserve(this->buffer_size + 1);
316
6.29k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
6.29k
    this->buffer_size++;
318
6.29k
  }
spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::push_back(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)
Line
Count
Source
314
3.81k
  {
315
3.81k
    reserve(this->buffer_size + 1);
316
3.81k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
3.81k
    this->buffer_size++;
318
3.81k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)2>&&)
Line
Count
Source
314
6.94k
  {
315
6.94k
    reserve(this->buffer_size + 1);
316
6.94k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
6.94k
    this->buffer_size++;
318
6.94k
  }
spirv_cross::SmallVector<std::__1::pair<unsigned int, unsigned int>, 8ul>::push_back(std::__1::pair<unsigned int, unsigned int>&&)
Line
Count
Source
314
2.09k
  {
315
2.09k
    reserve(this->buffer_size + 1);
316
2.09k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
2.09k
    this->buffer_size++;
318
2.09k
  }
spirv_cross::SmallVector<unsigned int, 8ul>::push_back(unsigned int&&)
Line
Count
Source
314
4.03k
  {
315
4.03k
    reserve(this->buffer_size + 1);
316
4.03k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
4.03k
    this->buffer_size++;
318
4.03k
  }
spirv_cross::SmallVector<bool, 8ul>::push_back(bool&&)
Line
Count
Source
314
2.96k
  {
315
2.96k
    reserve(this->buffer_size + 1);
316
2.96k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
2.96k
    this->buffer_size++;
318
2.96k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)1>&&)
Line
Count
Source
314
5.51k
  {
315
5.51k
    reserve(this->buffer_size + 1);
316
5.51k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
5.51k
    this->buffer_size++;
318
5.51k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::push_back(spirv_cross::SPIRBlock::Phi&&)
Line
Count
Source
314
4.04k
  {
315
4.04k
    reserve(this->buffer_size + 1);
316
4.04k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
4.04k
    this->buffer_size++;
318
4.04k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::push_back(spirv_cross::TypedID<(spirv_cross::Types)6>&&)
Line
Count
Source
314
11.7k
  {
315
11.7k
    reserve(this->buffer_size + 1);
316
11.7k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
11.7k
    this->buffer_size++;
318
11.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::push_back(spirv_cross::SPIRBlock::Case&&)
Line
Count
Source
314
1.90k
  {
315
1.90k
    reserve(this->buffer_size + 1);
316
1.90k
    new (&this->ptr[this->buffer_size]) T(std::move(t));
317
1.90k
    this->buffer_size++;
318
1.90k
  }
319
320
  void pop_back() SPIRV_CROSS_NOEXCEPT
321
247k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
247k
    if (!this->empty())
325
247k
      resize(this->buffer_size - 1);
326
247k
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::pop_back()
Line
Count
Source
321
142
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
142
    if (!this->empty())
325
142
      resize(this->buffer_size - 1);
326
142
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::pop_back()
Line
Count
Source
321
1.14k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
1.14k
    if (!this->empty())
325
1.14k
      resize(this->buffer_size - 1);
326
1.14k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::pop_back()
Line
Count
Source
321
97
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
97
    if (!this->empty())
325
97
      resize(this->buffer_size - 1);
326
97
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::pop_back()
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::pop_back()
Line
Count
Source
321
416
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
416
    if (!this->empty())
325
416
      resize(this->buffer_size - 1);
326
416
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::pop_back()
Line
Count
Source
321
15.0k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
15.0k
    if (!this->empty())
325
15.0k
      resize(this->buffer_size - 1);
326
15.0k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::pop_back()
Line
Count
Source
321
1.49k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
1.49k
    if (!this->empty())
325
1.49k
      resize(this->buffer_size - 1);
326
1.49k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::pop_back()
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::pop_back()
Line
Count
Source
321
1.82k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
1.82k
    if (!this->empty())
325
1.82k
      resize(this->buffer_size - 1);
326
1.82k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::pop_back()
Line
Count
Source
321
11.7k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
11.7k
    if (!this->empty())
325
11.7k
      resize(this->buffer_size - 1);
326
11.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::pop_back()
Line
Count
Source
321
2.04k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
2.04k
    if (!this->empty())
325
2.04k
      resize(this->buffer_size - 1);
326
2.04k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::pop_back()
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::pop_back()
Line
Count
Source
321
5.03k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
5.03k
    if (!this->empty())
325
5.03k
      resize(this->buffer_size - 1);
326
5.03k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::pop_back()
Line
Count
Source
321
208k
  {
322
    // Work around false positive warning on GCC 8.3.
323
    // Calling pop_back on empty vector is undefined.
324
208k
    if (!this->empty())
325
208k
      resize(this->buffer_size - 1);
326
208k
  }
327
328
  template <typename... Ts>
329
  void emplace_back(Ts &&... ts) SPIRV_CROSS_NOEXCEPT
330
840M
  {
331
840M
    reserve(this->buffer_size + 1);
332
840M
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
840M
    this->buffer_size++;
334
840M
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRUndef*&>(spirv_cross::SPIRUndef*&)
Line
Count
Source
330
62
  {
331
62
    reserve(this->buffer_size + 1);
332
62
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
62
    this->buffer_size++;
334
62
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRString*&>(spirv_cross::SPIRString*&)
Line
Count
Source
330
152
  {
331
152
    reserve(this->buffer_size + 1);
332
152
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
152
    this->buffer_size++;
334
152
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRDebugLocalVariable*&>(spirv_cross::SPIRDebugLocalVariable*&)
Line
Count
Source
330
24
  {
331
24
    reserve(this->buffer_size + 1);
332
24
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
24
    this->buffer_size++;
334
24
  }
Unexecuted instantiation: void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRCombinedImageSampler*&>(spirv_cross::SPIRCombinedImageSampler*&)
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRConstantOp*&>(spirv_cross::SPIRConstantOp*&)
Line
Count
Source
330
40
  {
331
40
    reserve(this->buffer_size + 1);
332
40
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
40
    this->buffer_size++;
334
40
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRType*&>(spirv_cross::SPIRType*&)
Line
Count
Source
330
1.18k
  {
331
1.18k
    reserve(this->buffer_size + 1);
332
1.18k
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
1.18k
    this->buffer_size++;
334
1.18k
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRExtension*&>(spirv_cross::SPIRExtension*&)
Line
Count
Source
330
577
  {
331
577
    reserve(this->buffer_size + 1);
332
577
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
577
    this->buffer_size++;
334
577
  }
Unexecuted instantiation: void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRExpression*&>(spirv_cross::SPIRExpression*&)
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRFunctionPrototype*&>(spirv_cross::SPIRFunctionPrototype*&)
Line
Count
Source
330
507
  {
331
507
    reserve(this->buffer_size + 1);
332
507
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
507
    this->buffer_size++;
334
507
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRBlock*&>(spirv_cross::SPIRBlock*&)
Line
Count
Source
330
610
  {
331
610
    reserve(this->buffer_size + 1);
332
610
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
610
    this->buffer_size++;
334
610
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRFunction*&>(spirv_cross::SPIRFunction*&)
Line
Count
Source
330
539
  {
331
539
    reserve(this->buffer_size + 1);
332
539
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
539
    this->buffer_size++;
334
539
  }
Unexecuted instantiation: void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRAccessChain*&>(spirv_cross::SPIRAccessChain*&)
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRVariable*&>(spirv_cross::SPIRVariable*&)
Line
Count
Source
330
592
  {
331
592
    reserve(this->buffer_size + 1);
332
592
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
592
    this->buffer_size++;
334
592
  }
void spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::emplace_back<spirv_cross::SPIRConstant*&>(spirv_cross::SPIRConstant*&)
Line
Count
Source
330
935
  {
331
935
    reserve(this->buffer_size + 1);
332
935
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
935
    this->buffer_size++;
334
935
  }
void spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::emplace_back<>()
Line
Count
Source
330
1.61k
  {
331
1.61k
    reserve(this->buffer_size + 1);
332
1.61k
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
1.61k
    this->buffer_size++;
334
1.61k
  }
void spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::emplace_back<spirv_cross::ObjectPoolGroup*>(spirv_cross::ObjectPoolGroup*&&)
Line
Count
Source
330
840M
  {
331
840M
    reserve(this->buffer_size + 1);
332
840M
    new (&this->ptr[this->buffer_size]) T(std::forward<Ts>(ts)...);
333
840M
    this->buffer_size++;
334
840M
  }
335
336
  void reserve(size_t count) SPIRV_CROSS_NOEXCEPT
337
898M
  {
338
898M
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
898M
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
898M
    if (count > buffer_capacity)
346
28.4k
    {
347
28.4k
      size_t target_capacity = buffer_capacity;
348
28.4k
      if (target_capacity == 0)
349
6.07k
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
28.4k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
135k
      while (target_capacity < count)
357
107k
        target_capacity <<= 1u;
358
359
28.4k
      T *new_buffer =
360
28.4k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
28.4k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
28.4k
      if (new_buffer != this->ptr)
368
28.4k
      {
369
        // We don't deal with types which can throw in move constructor.
370
3.51M
        for (size_t i = 0; i < this->buffer_size; i++)
371
3.48M
        {
372
3.48M
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
3.48M
          this->ptr[i].~T();
374
3.48M
        }
375
28.4k
      }
376
377
28.4k
      if (this->ptr != stack_storage.data())
378
6.79k
        free(this->ptr);
379
28.4k
      this->ptr = new_buffer;
380
28.4k
      buffer_capacity = target_capacity;
381
28.4k
    }
382
898M
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::StringStream<4096ul, 4096ul>::Buffer, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
1.19k
  {
338
1.19k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
1.19k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
1.19k
    if (count > buffer_capacity)
346
62
    {
347
62
      size_t target_capacity = buffer_capacity;
348
62
      if (target_capacity == 0)
349
62
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
62
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
310
      while (target_capacity < count)
357
248
        target_capacity <<= 1u;
358
359
62
      T *new_buffer =
360
62
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
62
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
62
      if (new_buffer != this->ptr)
368
62
      {
369
        // We don't deal with types which can throw in move constructor.
370
62
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
62
      }
376
377
62
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
62
      this->ptr = new_buffer;
380
62
      buffer_capacity = target_capacity;
381
62
    }
382
1.19k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRUndef, spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
62
  {
338
62
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
62
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
62
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
62
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
3.72k
  {
338
3.72k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
3.72k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
3.72k
    if (count > buffer_capacity)
346
152
    {
347
152
      size_t target_capacity = buffer_capacity;
348
152
      if (target_capacity == 0)
349
152
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
152
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
760
      while (target_capacity < count)
357
608
        target_capacity <<= 1u;
358
359
152
      T *new_buffer =
360
152
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
152
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
152
      if (new_buffer != this->ptr)
368
152
      {
369
        // We don't deal with types which can throw in move constructor.
370
152
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
152
      }
376
377
152
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
152
      this->ptr = new_buffer;
380
152
      buffer_capacity = target_capacity;
381
152
    }
382
3.72k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRString, spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
152
  {
338
152
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
152
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
152
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
152
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
505
  {
338
505
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
505
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
505
    if (count > buffer_capacity)
346
24
    {
347
24
      size_t target_capacity = buffer_capacity;
348
24
      if (target_capacity == 0)
349
24
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
24
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
120
      while (target_capacity < count)
357
96
        target_capacity <<= 1u;
358
359
24
      T *new_buffer =
360
24
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
24
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
24
      if (new_buffer != this->ptr)
368
24
      {
369
        // We don't deal with types which can throw in move constructor.
370
24
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
24
      }
376
377
24
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
24
      this->ptr = new_buffer;
380
24
      buffer_capacity = target_capacity;
381
24
    }
382
505
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRDebugLocalVariable, spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
24
  {
338
24
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
24
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
24
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
24
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::reserve(unsigned long)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRCombinedImageSampler, spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter>, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<unsigned int, 8ul>::reserve(unsigned long)
Line
Count
Source
337
110k
  {
338
110k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
110k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
110k
    if (count > buffer_capacity)
346
4.70k
    {
347
4.70k
      size_t target_capacity = buffer_capacity;
348
4.70k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
4.70k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
11.5k
      while (target_capacity < count)
357
6.82k
        target_capacity <<= 1u;
358
359
4.70k
      T *new_buffer =
360
4.70k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
4.70k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
4.70k
      if (new_buffer != this->ptr)
368
4.70k
      {
369
        // We don't deal with types which can throw in move constructor.
370
8.37k
        for (size_t i = 0; i < this->buffer_size; i++)
371
3.66k
        {
372
3.66k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
3.66k
          this->ptr[i].~T();
374
3.66k
        }
375
4.70k
      }
376
377
4.70k
      if (this->ptr != stack_storage.data())
378
78
        free(this->ptr);
379
4.70k
      this->ptr = new_buffer;
380
4.70k
      buffer_capacity = target_capacity;
381
4.70k
    }
382
110k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
1.09k
  {
338
1.09k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
1.09k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
1.09k
    if (count > buffer_capacity)
346
40
    {
347
40
      size_t target_capacity = buffer_capacity;
348
40
      if (target_capacity == 0)
349
40
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
40
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
200
      while (target_capacity < count)
357
160
        target_capacity <<= 1u;
358
359
40
      T *new_buffer =
360
40
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
40
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
40
      if (new_buffer != this->ptr)
368
40
      {
369
        // We don't deal with types which can throw in move constructor.
370
40
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
40
      }
376
377
40
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
40
      this->ptr = new_buffer;
380
40
      buffer_capacity = target_capacity;
381
40
    }
382
1.09k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstantOp, spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
40
  {
338
40
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
40
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
40
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
40
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
36.2k
  {
338
36.2k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
36.2k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
36.2k
    if (count > buffer_capacity)
346
1.25k
    {
347
1.25k
      size_t target_capacity = buffer_capacity;
348
1.25k
      if (target_capacity == 0)
349
1.10k
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
1.25k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
5.83k
      while (target_capacity < count)
357
4.58k
        target_capacity <<= 1u;
358
359
1.25k
      T *new_buffer =
360
1.25k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
1.25k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
1.25k
      if (new_buffer != this->ptr)
368
1.25k
      {
369
        // We don't deal with types which can throw in move constructor.
370
3.55k
        for (size_t i = 0; i < this->buffer_size; i++)
371
2.30k
        {
372
2.30k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
2.30k
          this->ptr[i].~T();
374
2.30k
        }
375
1.25k
      }
376
377
1.25k
      if (this->ptr != stack_storage.data())
378
144
        free(this->ptr);
379
1.25k
      this->ptr = new_buffer;
380
1.25k
      buffer_capacity = target_capacity;
381
1.25k
    }
382
36.2k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRType, spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
1.18k
  {
338
1.18k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
1.18k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
1.18k
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
1.18k
  }
spirv_cross::SmallVector<bool, 8ul>::reserve(unsigned long)
Line
Count
Source
337
11.7k
  {
338
11.7k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
11.7k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
11.7k
    if (count > buffer_capacity)
346
1.24k
    {
347
1.24k
      size_t target_capacity = buffer_capacity;
348
1.24k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
1.24k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
4.26k
      while (target_capacity < count)
357
3.02k
        target_capacity <<= 1u;
358
359
1.24k
      T *new_buffer =
360
1.24k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
1.24k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
1.24k
      if (new_buffer != this->ptr)
368
1.24k
      {
369
        // We don't deal with types which can throw in move constructor.
370
3.77k
        for (size_t i = 0; i < this->buffer_size; i++)
371
2.52k
        {
372
2.52k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
2.52k
          this->ptr[i].~T();
374
2.52k
        }
375
1.24k
      }
376
377
1.24k
      if (this->ptr != stack_storage.data())
378
69
        free(this->ptr);
379
1.24k
      this->ptr = new_buffer;
380
1.24k
      buffer_capacity = target_capacity;
381
1.24k
    }
382
11.7k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)1>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
14.2k
  {
338
14.2k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
14.2k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
14.2k
    if (count > buffer_capacity)
346
425
    {
347
425
      size_t target_capacity = buffer_capacity;
348
425
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
425
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
986
      while (target_capacity < count)
357
561
        target_capacity <<= 1u;
358
359
425
      T *new_buffer =
360
425
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
425
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
425
      if (new_buffer != this->ptr)
368
425
      {
369
        // We don't deal with types which can throw in move constructor.
370
4.56k
        for (size_t i = 0; i < this->buffer_size; i++)
371
4.13k
        {
372
4.13k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
4.13k
          this->ptr[i].~T();
374
4.13k
        }
375
425
      }
376
377
425
      if (this->ptr != stack_storage.data())
378
139
        free(this->ptr);
379
425
      this->ptr = new_buffer;
380
425
      buffer_capacity = target_capacity;
381
425
    }
382
14.2k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
11.3k
  {
338
11.3k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
11.3k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
11.3k
    if (count > buffer_capacity)
346
577
    {
347
577
      size_t target_capacity = buffer_capacity;
348
577
      if (target_capacity == 0)
349
577
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
577
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2.88k
      while (target_capacity < count)
357
2.30k
        target_capacity <<= 1u;
358
359
577
      T *new_buffer =
360
577
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
577
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
577
      if (new_buffer != this->ptr)
368
577
      {
369
        // We don't deal with types which can throw in move constructor.
370
577
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
577
      }
376
377
577
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
577
      this->ptr = new_buffer;
380
577
      buffer_capacity = target_capacity;
381
577
    }
382
11.3k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExtension, spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
577
  {
338
577
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
577
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
577
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
577
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::reserve(unsigned long)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRExpression, spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter>, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
336k
  {
338
336k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
336k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
336k
    if (count > buffer_capacity)
346
2.84k
    {
347
2.84k
      size_t target_capacity = buffer_capacity;
348
2.84k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
2.84k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
5.69k
      while (target_capacity < count)
357
2.84k
        target_capacity <<= 1u;
358
359
2.84k
      T *new_buffer =
360
2.84k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
2.84k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
2.84k
      if (new_buffer != this->ptr)
368
2.84k
      {
369
        // We don't deal with types which can throw in move constructor.
370
397k
        for (size_t i = 0; i < this->buffer_size; i++)
371
394k
        {
372
394k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
394k
          this->ptr[i].~T();
374
394k
        }
375
2.84k
      }
376
377
2.84k
      if (this->ptr != stack_storage.data())
378
1.60k
        free(this->ptr);
379
2.84k
      this->ptr = new_buffer;
380
2.84k
      buffer_capacity = target_capacity;
381
2.84k
    }
382
336k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
10.4k
  {
338
10.4k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
10.4k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
10.4k
    if (count > buffer_capacity)
346
507
    {
347
507
      size_t target_capacity = buffer_capacity;
348
507
      if (target_capacity == 0)
349
507
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
507
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2.53k
      while (target_capacity < count)
357
2.02k
        target_capacity <<= 1u;
358
359
507
      T *new_buffer =
360
507
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
507
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
507
      if (new_buffer != this->ptr)
368
507
      {
369
        // We don't deal with types which can throw in move constructor.
370
507
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
507
      }
376
377
507
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
507
      this->ptr = new_buffer;
380
507
      buffer_capacity = target_capacity;
381
507
    }
382
10.4k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunctionPrototype, spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
507
  {
338
507
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
507
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
507
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
507
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
24.6k
  {
338
24.6k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
24.6k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
24.6k
    if (count > buffer_capacity)
346
670
    {
347
670
      size_t target_capacity = buffer_capacity;
348
670
      if (target_capacity == 0)
349
529
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
670
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2.92k
      while (target_capacity < count)
357
2.25k
        target_capacity <<= 1u;
358
359
670
      T *new_buffer =
360
670
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
670
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
670
      if (new_buffer != this->ptr)
368
670
      {
369
        // We don't deal with types which can throw in move constructor.
370
3.51k
        for (size_t i = 0; i < this->buffer_size; i++)
371
2.84k
        {
372
2.84k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
2.84k
          this->ptr[i].~T();
374
2.84k
        }
375
670
      }
376
377
670
      if (this->ptr != stack_storage.data())
378
141
        free(this->ptr);
379
670
      this->ptr = new_buffer;
380
670
      buffer_capacity = target_capacity;
381
670
    }
382
24.6k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRBlock, spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
610
  {
338
610
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
610
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
610
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
610
  }
spirv_cross::SmallVector<spirv_cross::Instruction, 8ul>::reserve(unsigned long)
Line
Count
Source
337
353k
  {
338
353k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
353k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
353k
    if (count > buffer_capacity)
346
5.33k
    {
347
5.33k
      size_t target_capacity = buffer_capacity;
348
5.33k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
5.33k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
10.6k
      while (target_capacity < count)
357
5.33k
        target_capacity <<= 1u;
358
359
5.33k
      T *new_buffer =
360
5.33k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
5.33k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
5.33k
      if (new_buffer != this->ptr)
368
5.33k
      {
369
        // We don't deal with types which can throw in move constructor.
370
461k
        for (size_t i = 0; i < this->buffer_size; i++)
371
456k
        {
372
456k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
456k
          this->ptr[i].~T();
374
456k
        }
375
5.33k
      }
376
377
5.33k
      if (this->ptr != stack_storage.data())
378
3.27k
        free(this->ptr);
379
5.33k
      this->ptr = new_buffer;
380
5.33k
      buffer_capacity = target_capacity;
381
5.33k
    }
382
353k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Phi, 8ul>::reserve(unsigned long)
Line
Count
Source
337
4.04k
  {
338
4.04k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
4.04k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
4.04k
    if (count > buffer_capacity)
346
122
    {
347
122
      size_t target_capacity = buffer_capacity;
348
122
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
122
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
244
      while (target_capacity < count)
357
122
        target_capacity <<= 1u;
358
359
122
      T *new_buffer =
360
122
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
122
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
122
      if (new_buffer != this->ptr)
368
122
      {
369
        // We don't deal with types which can throw in move constructor.
370
4.59k
        for (size_t i = 0; i < this->buffer_size; i++)
371
4.47k
        {
372
4.47k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
4.47k
          this->ptr[i].~T();
374
4.47k
        }
375
122
      }
376
377
122
      if (this->ptr != stack_storage.data())
378
69
        free(this->ptr);
379
122
      this->ptr = new_buffer;
380
122
      buffer_capacity = target_capacity;
381
122
    }
382
4.04k
  }
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::pair<spirv_cross::TypedID<(spirv_cross::Types)1>, spirv_cross::TypedID<(spirv_cross::Types)0> >, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRBlock::Case, 8ul>::reserve(unsigned long)
Line
Count
Source
337
1.90k
  {
338
1.90k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
1.90k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
1.90k
    if (count > buffer_capacity)
346
93
    {
347
93
      size_t target_capacity = buffer_capacity;
348
93
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
93
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
186
      while (target_capacity < count)
357
93
        target_capacity <<= 1u;
358
359
93
      T *new_buffer =
360
93
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
93
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
93
      if (new_buffer != this->ptr)
368
93
      {
369
        // We don't deal with types which can throw in move constructor.
370
845
        for (size_t i = 0; i < this->buffer_size; i++)
371
752
        {
372
752
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
752
          this->ptr[i].~T();
374
752
        }
375
93
      }
376
377
93
      if (this->ptr != stack_storage.data())
378
1
        free(this->ptr);
379
93
      this->ptr = new_buffer;
380
93
      buffer_capacity = target_capacity;
381
93
    }
382
1.90k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)2>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
23.2k
  {
338
23.2k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
23.2k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
23.2k
    if (count > buffer_capacity)
346
370
    {
347
370
      size_t target_capacity = buffer_capacity;
348
370
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
370
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
740
      while (target_capacity < count)
357
370
        target_capacity <<= 1u;
358
359
370
      T *new_buffer =
360
370
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
370
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
370
      if (new_buffer != this->ptr)
368
370
      {
369
        // We don't deal with types which can throw in move constructor.
370
10.7k
        for (size_t i = 0; i < this->buffer_size; i++)
371
10.3k
        {
372
10.3k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
10.3k
          this->ptr[i].~T();
374
10.3k
        }
375
370
      }
376
377
370
      if (this->ptr != stack_storage.data())
378
185
        free(this->ptr);
379
370
      this->ptr = new_buffer;
380
370
      buffer_capacity = target_capacity;
381
370
    }
382
23.2k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction::Parameter, 8ul>::reserve(unsigned long)
Line
Count
Source
337
356
  {
338
356
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
356
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
356
    if (count > buffer_capacity)
346
1
    {
347
1
      size_t target_capacity = buffer_capacity;
348
1
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
1
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2
      while (target_capacity < count)
357
1
        target_capacity <<= 1u;
358
359
1
      T *new_buffer =
360
1
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
1
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
1
      if (new_buffer != this->ptr)
368
1
      {
369
        // We don't deal with types which can throw in move constructor.
370
9
        for (size_t i = 0; i < this->buffer_size; i++)
371
8
        {
372
8
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
8
          this->ptr[i].~T();
374
8
        }
375
1
      }
376
377
1
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
1
      this->ptr = new_buffer;
380
1
      buffer_capacity = target_capacity;
381
1
    }
382
356
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
11.2k
  {
338
11.2k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
11.2k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
11.2k
    if (count > buffer_capacity)
346
539
    {
347
539
      size_t target_capacity = buffer_capacity;
348
539
      if (target_capacity == 0)
349
539
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
539
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2.69k
      while (target_capacity < count)
357
2.15k
        target_capacity <<= 1u;
358
359
539
      T *new_buffer =
360
539
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
539
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
539
      if (new_buffer != this->ptr)
368
539
      {
369
        // We don't deal with types which can throw in move constructor.
370
539
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
539
      }
376
377
539
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
539
      this->ptr = new_buffer;
380
539
      buffer_capacity = target_capacity;
381
539
    }
382
11.2k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRFunction, spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
539
  {
338
539
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
539
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
539
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
539
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)6>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
11.7k
  {
338
11.7k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
11.7k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
11.7k
    if (count > buffer_capacity)
346
293
    {
347
293
      size_t target_capacity = buffer_capacity;
348
293
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
293
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
586
      while (target_capacity < count)
357
293
        target_capacity <<= 1u;
358
359
293
      T *new_buffer =
360
293
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
293
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
293
      if (new_buffer != this->ptr)
368
293
      {
369
        // We don't deal with types which can throw in move constructor.
370
6.23k
        for (size_t i = 0; i < this->buffer_size; i++)
371
5.94k
        {
372
5.94k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
5.94k
          this->ptr[i].~T();
374
5.94k
        }
375
293
      }
376
377
293
      if (this->ptr != stack_storage.data())
378
136
        free(this->ptr);
379
293
      this->ptr = new_buffer;
380
293
      buffer_capacity = target_capacity;
381
293
    }
382
11.7k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRFunction::CombinedImageSamplerParameter, 8ul>::reserve(unsigned long)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::function<void ()>, 0ul>::reserve(unsigned long)
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::reserve(unsigned long)
Unexecuted instantiation: spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRAccessChain, spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter>, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
16.2k
  {
338
16.2k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
16.2k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
16.2k
    if (count > buffer_capacity)
346
645
    {
347
645
      size_t target_capacity = buffer_capacity;
348
645
      if (target_capacity == 0)
349
533
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
645
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
2.88k
      while (target_capacity < count)
357
2.24k
        target_capacity <<= 1u;
358
359
645
      T *new_buffer =
360
645
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
645
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
645
      if (new_buffer != this->ptr)
368
645
      {
369
        // We don't deal with types which can throw in move constructor.
370
2.53k
        for (size_t i = 0; i < this->buffer_size; i++)
371
1.88k
        {
372
1.88k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
1.88k
          this->ptr[i].~T();
374
1.88k
        }
375
645
      }
376
377
645
      if (this->ptr != stack_storage.data())
378
112
        free(this->ptr);
379
645
      this->ptr = new_buffer;
380
645
      buffer_capacity = target_capacity;
381
645
    }
382
16.2k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRVariable, spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
592
  {
338
592
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
592
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
592
    if (count > buffer_capacity)
346
0
    {
347
0
      size_t target_capacity = buffer_capacity;
348
0
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
0
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
0
      while (target_capacity < count)
357
0
        target_capacity <<= 1u;
358
359
0
      T *new_buffer =
360
0
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
0
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
0
      if (new_buffer != this->ptr)
368
0
      {
369
        // We don't deal with types which can throw in move constructor.
370
0
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
0
      }
376
377
0
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
0
      this->ptr = new_buffer;
380
0
      buffer_capacity = target_capacity;
381
0
    }
382
592
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)3>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
55.6M
  {
338
55.6M
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
55.6M
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
55.6M
    if (count > buffer_capacity)
346
67
    {
347
67
      size_t target_capacity = buffer_capacity;
348
67
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
67
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
453
      while (target_capacity < count)
357
386
        target_capacity <<= 1u;
358
359
67
      T *new_buffer =
360
67
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
67
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
67
      if (new_buffer != this->ptr)
368
67
      {
369
        // We don't deal with types which can throw in move constructor.
370
67
        for (size_t i = 0; i < this->buffer_size; i++)
371
0
        {
372
0
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
0
          this->ptr[i].~T();
374
0
        }
375
67
      }
376
377
67
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
67
      this->ptr = new_buffer;
380
67
      buffer_capacity = target_capacity;
381
67
    }
382
55.6M
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::reserve(unsigned long)
Line
Count
Source
337
397k
  {
338
397k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
397k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
397k
    if (count > buffer_capacity)
346
1.07k
    {
347
1.07k
      size_t target_capacity = buffer_capacity;
348
1.07k
      if (target_capacity == 0)
349
617
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
1.07k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
3.99k
      while (target_capacity < count)
357
2.92k
        target_capacity <<= 1u;
358
359
1.07k
      T *new_buffer =
360
1.07k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
1.07k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
1.07k
      if (new_buffer != this->ptr)
368
1.07k
      {
369
        // We don't deal with types which can throw in move constructor.
370
92.2k
        for (size_t i = 0; i < this->buffer_size; i++)
371
91.1k
        {
372
91.1k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
91.1k
          this->ptr[i].~T();
374
91.1k
        }
375
1.07k
      }
376
377
1.07k
      if (this->ptr != stack_storage.data())
378
453
        free(this->ptr);
379
1.07k
      this->ptr = new_buffer;
380
1.07k
      buffer_capacity = target_capacity;
381
1.07k
    }
382
397k
  }
spirv_cross::SmallVector<std::__1::unique_ptr<spirv_cross::SPIRConstant, spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
935
  {
338
935
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
935
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
935
    if (count > buffer_capacity)
346
12
    {
347
12
      size_t target_capacity = buffer_capacity;
348
12
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
12
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
24
      while (target_capacity < count)
357
12
        target_capacity <<= 1u;
358
359
12
      T *new_buffer =
360
12
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
12
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
12
      if (new_buffer != this->ptr)
368
12
      {
369
        // We don't deal with types which can throw in move constructor.
370
108
        for (size_t i = 0; i < this->buffer_size; i++)
371
96
        {
372
96
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
96
          this->ptr[i].~T();
374
96
        }
375
12
      }
376
377
12
      if (this->ptr != stack_storage.data())
378
0
        free(this->ptr);
379
12
      this->ptr = new_buffer;
380
12
      buffer_capacity = target_capacity;
381
12
    }
382
935
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)4>, 8ul>::reserve(unsigned long)
spirv_cross::SmallVector<spirv_cross::ParsedIR::Source::Marker, 8ul>::reserve(unsigned long)
Line
Count
Source
337
4.51k
  {
338
4.51k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
4.51k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
4.51k
    if (count > buffer_capacity)
346
93
    {
347
93
      size_t target_capacity = buffer_capacity;
348
93
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
93
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
186
      while (target_capacity < count)
357
93
        target_capacity <<= 1u;
358
359
93
      T *new_buffer =
360
93
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
93
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
93
      if (new_buffer != this->ptr)
368
93
      {
369
        // We don't deal with types which can throw in move constructor.
370
1.78k
        for (size_t i = 0; i < this->buffer_size; i++)
371
1.69k
        {
372
1.69k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
1.69k
          this->ptr[i].~T();
374
1.69k
        }
375
93
      }
376
377
93
      if (this->ptr != stack_storage.data())
378
55
        free(this->ptr);
379
93
      this->ptr = new_buffer;
380
93
      buffer_capacity = target_capacity;
381
93
    }
382
4.51k
  }
spirv_cross::SmallVector<spv::Capability, 8ul>::reserve(unsigned long)
Line
Count
Source
337
6.29k
  {
338
6.29k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
6.29k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
6.29k
    if (count > buffer_capacity)
346
82
    {
347
82
      size_t target_capacity = buffer_capacity;
348
82
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
82
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
164
      while (target_capacity < count)
357
82
        target_capacity <<= 1u;
358
359
82
      T *new_buffer =
360
82
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
82
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
82
      if (new_buffer != this->ptr)
368
82
      {
369
        // We don't deal with types which can throw in move constructor.
370
7.31k
        for (size_t i = 0; i < this->buffer_size; i++)
371
7.23k
        {
372
7.23k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
7.23k
          this->ptr[i].~T();
374
7.23k
        }
375
82
      }
376
377
82
      if (this->ptr != stack_storage.data())
378
58
        free(this->ptr);
379
82
      this->ptr = new_buffer;
380
82
      buffer_capacity = target_capacity;
381
82
    }
382
6.29k
  }
spirv_cross::SmallVector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, 8ul>::reserve(unsigned long)
Line
Count
Source
337
3.81k
  {
338
3.81k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
3.81k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
3.81k
    if (count > buffer_capacity)
346
76
    {
347
76
      size_t target_capacity = buffer_capacity;
348
76
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
76
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
152
      while (target_capacity < count)
357
76
        target_capacity <<= 1u;
358
359
76
      T *new_buffer =
360
76
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
76
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
76
      if (new_buffer != this->ptr)
368
76
      {
369
        // We don't deal with types which can throw in move constructor.
370
4.09k
        for (size_t i = 0; i < this->buffer_size; i++)
371
4.01k
        {
372
4.01k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
4.01k
          this->ptr[i].~T();
374
4.01k
        }
375
76
      }
376
377
76
      if (this->ptr != stack_storage.data())
378
54
        free(this->ptr);
379
76
      this->ptr = new_buffer;
380
76
      buffer_capacity = target_capacity;
381
76
    }
382
3.81k
  }
spirv_cross::SmallVector<std::__1::pair<unsigned int, unsigned int>, 8ul>::reserve(unsigned long)
Line
Count
Source
337
2.09k
  {
338
2.09k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
2.09k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
2.09k
    if (count > buffer_capacity)
346
104
    {
347
104
      size_t target_capacity = buffer_capacity;
348
104
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
104
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
208
      while (target_capacity < count)
357
104
        target_capacity <<= 1u;
358
359
104
      T *new_buffer =
360
104
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
104
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
104
      if (new_buffer != this->ptr)
368
104
      {
369
        // We don't deal with types which can throw in move constructor.
370
3.22k
        for (size_t i = 0; i < this->buffer_size; i++)
371
3.12k
        {
372
3.12k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
3.12k
          this->ptr[i].~T();
374
3.12k
        }
375
104
      }
376
377
104
      if (this->ptr != stack_storage.data())
378
70
        free(this->ptr);
379
104
      this->ptr = new_buffer;
380
104
      buffer_capacity = target_capacity;
381
104
    }
382
2.09k
  }
spirv_cross::SmallVector<unsigned char, 8ul>::reserve(unsigned long)
Line
Count
Source
337
99.8k
  {
338
99.8k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
99.8k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
99.8k
    if (count > buffer_capacity)
346
2.76k
    {
347
2.76k
      size_t target_capacity = buffer_capacity;
348
2.76k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
2.76k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
30.4k
      while (target_capacity < count)
357
27.6k
        target_capacity <<= 1u;
358
359
2.76k
      T *new_buffer =
360
2.76k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
2.76k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
2.76k
      if (new_buffer != this->ptr)
368
2.76k
      {
369
        // We don't deal with types which can throw in move constructor.
370
137k
        for (size_t i = 0; i < this->buffer_size; i++)
371
134k
        {
372
134k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
134k
          this->ptr[i].~T();
374
134k
        }
375
2.76k
      }
376
377
2.76k
      if (this->ptr != stack_storage.data())
378
22
        free(this->ptr);
379
2.76k
      this->ptr = new_buffer;
380
2.76k
      buffer_capacity = target_capacity;
381
2.76k
    }
382
99.8k
  }
spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::reserve(unsigned long)
Line
Count
Source
337
1.53k
  {
338
1.53k
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
1.53k
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
1.53k
    if (count > buffer_capacity)
346
1.49k
    {
347
1.49k
      size_t target_capacity = buffer_capacity;
348
1.49k
      if (target_capacity == 0)
349
1.38k
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
1.49k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
13.5k
      while (target_capacity < count)
357
12.1k
        target_capacity <<= 1u;
358
359
1.49k
      T *new_buffer =
360
1.49k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
1.49k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
1.49k
      if (new_buffer != this->ptr)
368
1.49k
      {
369
        // We don't deal with types which can throw in move constructor.
370
2.22M
        for (size_t i = 0; i < this->buffer_size; i++)
371
2.22M
        {
372
2.22M
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
2.22M
          this->ptr[i].~T();
374
2.22M
        }
375
1.49k
      }
376
377
1.49k
      if (this->ptr != stack_storage.data())
378
110
        free(this->ptr);
379
1.49k
      this->ptr = new_buffer;
380
1.49k
      buffer_capacity = target_capacity;
381
1.49k
    }
382
1.53k
  }
spirv_cross::SmallVector<spirv_cross::Variant, 8ul>::reserve(unsigned long)
Line
Count
Source
337
840M
  {
338
840M
    if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
339
840M
        (count > (std::numeric_limits<size_t>::max)() / 2))
340
0
    {
341
      // Only way this should ever happen is with garbage input, terminate.
342
0
      std::terminate();
343
0
    }
344
345
840M
    if (count > buffer_capacity)
346
2.76k
    {
347
2.76k
      size_t target_capacity = buffer_capacity;
348
2.76k
      if (target_capacity == 0)
349
0
        target_capacity = 1;
350
351
      // Weird parens works around macro issues on Windows if NOMINMAX is not used.
352
2.76k
      target_capacity = (std::max)(target_capacity, N);
353
354
      // Need to ensure there is a POT value of target capacity which is larger than count,
355
      // otherwise this will overflow.
356
30.4k
      while (target_capacity < count)
357
27.6k
        target_capacity <<= 1u;
358
359
2.76k
      T *new_buffer =
360
2.76k
          target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
361
362
      // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
363
2.76k
      if (!new_buffer)
364
0
        std::terminate();
365
366
      // In case for some reason two allocations both come from same stack.
367
2.76k
      if (new_buffer != this->ptr)
368
2.76k
      {
369
        // We don't deal with types which can throw in move constructor.
370
137k
        for (size_t i = 0; i < this->buffer_size; i++)
371
134k
        {
372
134k
          new (&new_buffer[i]) T(std::move(this->ptr[i]));
373
134k
          this->ptr[i].~T();
374
134k
        }
375
2.76k
      }
376
377
2.76k
      if (this->ptr != stack_storage.data())
378
22
        free(this->ptr);
379
2.76k
      this->ptr = new_buffer;
380
2.76k
      buffer_capacity = target_capacity;
381
2.76k
    }
382
840M
  }
383
384
  void insert(T *itr, const T *insert_begin, const T *insert_end) SPIRV_CROSS_NOEXCEPT
385
  {
386
    auto count = size_t(insert_end - insert_begin);
387
    if (itr == this->end())
388
    {
389
      reserve(this->buffer_size + count);
390
      for (size_t i = 0; i < count; i++, insert_begin++)
391
        new (&this->ptr[this->buffer_size + i]) T(*insert_begin);
392
      this->buffer_size += count;
393
    }
394
    else
395
    {
396
      if (this->buffer_size + count > buffer_capacity)
397
      {
398
        auto target_capacity = this->buffer_size + count;
399
        if (target_capacity == 0)
400
          target_capacity = 1;
401
        if (target_capacity < N)
402
          target_capacity = N;
403
404
        while (target_capacity < count)
405
          target_capacity <<= 1u;
406
407
        // Need to allocate new buffer. Move everything to a new buffer.
408
        T *new_buffer =
409
            target_capacity > N ? static_cast<T *>(malloc(target_capacity * sizeof(T))) : stack_storage.data();
410
411
        // If we actually fail this malloc, we are hosed anyways, there is no reason to attempt recovery.
412
        if (!new_buffer)
413
          std::terminate();
414
415
        // First, move elements from source buffer to new buffer.
416
        // We don't deal with types which can throw in move constructor.
417
        auto *target_itr = new_buffer;
418
        auto *original_source_itr = this->begin();
419
420
        if (new_buffer != this->ptr)
421
        {
422
          while (original_source_itr != itr)
423
          {
424
            new (target_itr) T(std::move(*original_source_itr));
425
            original_source_itr->~T();
426
            ++original_source_itr;
427
            ++target_itr;
428
          }
429
        }
430
431
        // Copy-construct new elements.
432
        for (auto *source_itr = insert_begin; source_itr != insert_end; ++source_itr, ++target_itr)
433
          new (target_itr) T(*source_itr);
434
435
        // Move over the other half.
436
        if (new_buffer != this->ptr || insert_begin != insert_end)
437
        {
438
          while (original_source_itr != this->end())
439
          {
440
            new (target_itr) T(std::move(*original_source_itr));
441
            original_source_itr->~T();
442
            ++original_source_itr;
443
            ++target_itr;
444
          }
445
        }
446
447
        if (this->ptr != stack_storage.data())
448
          free(this->ptr);
449
        this->ptr = new_buffer;
450
        buffer_capacity = target_capacity;
451
      }
452
      else
453
      {
454
        // Move in place, need to be a bit careful about which elements are constructed and which are not.
455
        // Move the end and construct the new elements.
456
        auto *target_itr = this->end() + count;
457
        auto *source_itr = this->end();
458
        while (target_itr != this->end() && source_itr != itr)
459
        {
460
          --target_itr;
461
          --source_itr;
462
          new (target_itr) T(std::move(*source_itr));
463
        }
464
465
        // For already constructed elements we can move-assign.
466
        std::move_backward(itr, source_itr, target_itr);
467
468
        // For the inserts which go to already constructed elements, we can do a plain copy.
469
        while (itr != this->end() && insert_begin != insert_end)
470
          *itr++ = *insert_begin++;
471
472
        // For inserts into newly allocated memory, we must copy-construct instead.
473
        while (insert_begin != insert_end)
474
        {
475
          new (itr) T(*insert_begin);
476
          ++itr;
477
          ++insert_begin;
478
        }
479
      }
480
481
      this->buffer_size += count;
482
    }
483
  }
484
485
  void insert(T *itr, const T &value) SPIRV_CROSS_NOEXCEPT
486
  {
487
    insert(itr, &value, &value + 1);
488
  }
489
490
  T *erase(T *itr) SPIRV_CROSS_NOEXCEPT
491
  {
492
    std::move(itr + 1, this->end(), itr);
493
    this->ptr[--this->buffer_size].~T();
494
    return itr;
495
  }
496
497
  void erase(T *start_erase, T *end_erase) SPIRV_CROSS_NOEXCEPT
498
62
  {
499
62
    if (end_erase == this->end())
500
62
    {
501
62
      resize(size_t(start_erase - this->begin()));
502
62
    }
503
0
    else
504
0
    {
505
0
      auto new_size = this->buffer_size - (end_erase - start_erase);
506
0
      std::move(end_erase, this->end(), start_erase);
507
0
      resize(new_size);
508
0
    }
509
62
  }
510
511
  void resize(size_t new_size) SPIRV_CROSS_NOEXCEPT
512
465k
  {
513
465k
    if (new_size < this->buffer_size)
514
247k
    {
515
494k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
247k
        this->ptr[i].~T();
517
247k
    }
518
218k
    else if (new_size > this->buffer_size)
519
104k
    {
520
104k
      reserve(new_size);
521
1.05G
      for (size_t i = this->buffer_size; i < new_size; i++)
522
1.05G
        new (&this->ptr[i]) T();
523
104k
    }
524
525
465k
    this->buffer_size = new_size;
526
465k
  }
spirv_cross::SmallVector<spirv_cross::SPIRUndef*, 0ul>::resize(unsigned long)
Line
Count
Source
512
142
  {
513
142
    if (new_size < this->buffer_size)
514
142
    {
515
284
      for (size_t i = new_size; i < this->buffer_size; i++)
516
142
        this->ptr[i].~T();
517
142
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
142
    this->buffer_size = new_size;
526
142
  }
spirv_cross::SmallVector<spirv_cross::SPIRString*, 0ul>::resize(unsigned long)
Line
Count
Source
512
1.14k
  {
513
1.14k
    if (new_size < this->buffer_size)
514
1.14k
    {
515
2.28k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
1.14k
        this->ptr[i].~T();
517
1.14k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
1.14k
    this->buffer_size = new_size;
526
1.14k
  }
spirv_cross::SmallVector<spirv_cross::SPIRDebugLocalVariable*, 0ul>::resize(unsigned long)
Line
Count
Source
512
97
  {
513
97
    if (new_size < this->buffer_size)
514
97
    {
515
194
      for (size_t i = new_size; i < this->buffer_size; i++)
516
97
        this->ptr[i].~T();
517
97
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
97
    this->buffer_size = new_size;
526
97
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRCombinedImageSampler*, 0ul>::resize(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRConstantOp*, 0ul>::resize(unsigned long)
Line
Count
Source
512
416
  {
513
416
    if (new_size < this->buffer_size)
514
416
    {
515
832
      for (size_t i = new_size; i < this->buffer_size; i++)
516
416
        this->ptr[i].~T();
517
416
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
416
    this->buffer_size = new_size;
526
416
  }
spirv_cross::SmallVector<spirv_cross::SPIRType*, 0ul>::resize(unsigned long)
Line
Count
Source
512
15.0k
  {
513
15.0k
    if (new_size < this->buffer_size)
514
15.0k
    {
515
30.1k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
15.0k
        this->ptr[i].~T();
517
15.0k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
15.0k
    this->buffer_size = new_size;
526
15.0k
  }
spirv_cross::SmallVector<spirv_cross::SPIRExtension*, 0ul>::resize(unsigned long)
Line
Count
Source
512
1.49k
  {
513
1.49k
    if (new_size < this->buffer_size)
514
1.49k
    {
515
2.99k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
1.49k
        this->ptr[i].~T();
517
1.49k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
1.49k
    this->buffer_size = new_size;
526
1.49k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRExpression*, 0ul>::resize(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRFunctionPrototype*, 0ul>::resize(unsigned long)
Line
Count
Source
512
1.82k
  {
513
1.82k
    if (new_size < this->buffer_size)
514
1.82k
    {
515
3.65k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
1.82k
        this->ptr[i].~T();
517
1.82k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
1.82k
    this->buffer_size = new_size;
526
1.82k
  }
spirv_cross::SmallVector<spirv_cross::SPIRBlock*, 0ul>::resize(unsigned long)
Line
Count
Source
512
11.7k
  {
513
11.7k
    if (new_size < this->buffer_size)
514
11.7k
    {
515
23.5k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
11.7k
        this->ptr[i].~T();
517
11.7k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
11.7k
    this->buffer_size = new_size;
526
11.7k
  }
spirv_cross::SmallVector<spirv_cross::SPIRFunction*, 0ul>::resize(unsigned long)
Line
Count
Source
512
2.04k
  {
513
2.04k
    if (new_size < this->buffer_size)
514
2.04k
    {
515
4.08k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
2.04k
        this->ptr[i].~T();
517
2.04k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
2.04k
    this->buffer_size = new_size;
526
2.04k
  }
Unexecuted instantiation: spirv_cross::SmallVector<spirv_cross::SPIRAccessChain*, 0ul>::resize(unsigned long)
spirv_cross::SmallVector<spirv_cross::SPIRVariable*, 0ul>::resize(unsigned long)
Line
Count
Source
512
5.03k
  {
513
5.03k
    if (new_size < this->buffer_size)
514
5.03k
    {
515
10.0k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
5.03k
        this->ptr[i].~T();
517
5.03k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
5.03k
    this->buffer_size = new_size;
526
5.03k
  }
spirv_cross::SmallVector<spirv_cross::SPIRConstant*, 0ul>::resize(unsigned long)
Line
Count
Source
512
208k
  {
513
208k
    if (new_size < this->buffer_size)
514
208k
    {
515
416k
      for (size_t i = new_size; i < this->buffer_size; i++)
516
208k
        this->ptr[i].~T();
517
208k
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
208k
    this->buffer_size = new_size;
526
208k
  }
spirv_cross::SmallVector<unsigned char, 8ul>::resize(unsigned long)
Line
Count
Source
512
99.9k
  {
513
99.9k
    if (new_size < this->buffer_size)
514
0
    {
515
0
      for (size_t i = new_size; i < this->buffer_size; i++)
516
0
        this->ptr[i].~T();
517
0
    }
518
99.9k
    else if (new_size > this->buffer_size)
519
99.8k
    {
520
99.8k
      reserve(new_size);
521
840M
      for (size_t i = this->buffer_size; i < new_size; i++)
522
840M
        new (&this->ptr[i]) T();
523
99.8k
    }
524
525
99.9k
    this->buffer_size = new_size;
526
99.9k
  }
spirv_cross::SmallVector<spirv_cross::Meta::Decoration, 0ul>::resize(unsigned long)
Line
Count
Source
512
21.8k
  {
513
21.8k
    if (new_size < this->buffer_size)
514
0
    {
515
0
      for (size_t i = new_size; i < this->buffer_size; i++)
516
0
        this->ptr[i].~T();
517
0
    }
518
21.8k
    else if (new_size > this->buffer_size)
519
1.53k
    {
520
1.53k
      reserve(new_size);
521
160M
      for (size_t i = this->buffer_size; i < new_size; i++)
522
160M
        new (&this->ptr[i]) T();
523
1.53k
    }
524
525
21.8k
    this->buffer_size = new_size;
526
21.8k
  }
spirv_cross::SmallVector<spirv_cross::TypedID<(spirv_cross::Types)0>, 8ul>::resize(unsigned long)
Line
Count
Source
512
62
  {
513
62
    if (new_size < this->buffer_size)
514
62
    {
515
124
      for (size_t i = new_size; i < this->buffer_size; i++)
516
62
        this->ptr[i].~T();
517
62
    }
518
0
    else if (new_size > this->buffer_size)
519
0
    {
520
0
      reserve(new_size);
521
0
      for (size_t i = this->buffer_size; i < new_size; i++)
522
0
        new (&this->ptr[i]) T();
523
0
    }
524
525
62
    this->buffer_size = new_size;
526
62
  }
spirv_cross::SmallVector<unsigned int, 8ul>::resize(unsigned long)
Line
Count
Source
512
96.8k
  {
513
96.8k
    if (new_size < this->buffer_size)
514
0
    {
515
0
      for (size_t i = new_size; i < this->buffer_size; i++)
516
0
        this->ptr[i].~T();
517
0
    }
518
96.8k
    else if (new_size > this->buffer_size)
519
3.10k
    {
520
3.10k
      reserve(new_size);
521
55.5M
      for (size_t i = this->buffer_size; i < new_size; i++)
522
55.5M
        new (&this->ptr[i]) T();
523
3.10k
    }
524
525
96.8k
    this->buffer_size = new_size;
526
96.8k
  }
527
528
private:
529
  size_t buffer_capacity = 0;
530
  AlignedBuffer<T, N> stack_storage;
531
};
532
533
// A vector without stack storage.
534
// Could also be a typedef-ed to std::vector,
535
// but might as well use the one we have.
536
template <typename T>
537
using Vector = SmallVector<T, 0>;
538
539
#else // SPIRV_CROSS_FORCE_STL_TYPES
540
541
template <typename T, size_t N = 8>
542
using SmallVector = std::vector<T>;
543
template <typename T>
544
using Vector = std::vector<T>;
545
template <typename T>
546
using VectorView = std::vector<T>;
547
548
#endif // SPIRV_CROSS_FORCE_STL_TYPES
549
550
// An object pool which we use for allocating IVariant-derived objects.
551
// We know we are going to allocate a bunch of objects of each type,
552
// so amortize the mallocs.
553
class ObjectPoolBase
554
{
555
public:
556
42.5k
  virtual ~ObjectPoolBase() = default;
557
  virtual void deallocate_opaque(void *ptr) = 0;
558
};
559
560
template <typename T>
561
class ObjectPool : public ObjectPoolBase
562
{
563
public:
564
  explicit ObjectPool(unsigned start_object_count_ = 16)
565
42.5k
      : start_object_count(start_object_count_)
566
42.5k
  {
567
42.5k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRType>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRString>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::ObjectPool(unsigned int)
Line
Count
Source
565
3.04k
      : start_object_count(start_object_count_)
566
3.04k
  {
567
3.04k
  }
568
569
  template <typename... P>
570
  T *allocate(P &&... p)
571
247k
  {
572
247k
    if (vacants.empty())
573
5.21k
    {
574
5.21k
      unsigned num_objects = start_object_count << memory.size();
575
5.21k
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
5.21k
      if (!ptr)
577
0
        return nullptr;
578
579
5.21k
      vacants.reserve(num_objects);
580
266k
      for (unsigned i = 0; i < num_objects; i++)
581
261k
        vacants.push_back(&ptr[i]);
582
583
5.21k
      memory.emplace_back(ptr);
584
5.21k
    }
585
586
247k
    T *ptr = vacants.back();
587
247k
    vacants.pop_back();
588
247k
    new (ptr) T(std::forward<P>(p)...);
589
247k
    return ptr;
590
247k
  }
Unexecuted instantiation: spirv_cross::SPIRUndef* spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::allocate<spirv_cross::SPIRUndef&>(spirv_cross::SPIRUndef&)
Unexecuted instantiation: spirv_cross::SPIRString* spirv_cross::ObjectPool<spirv_cross::SPIRString>::allocate<spirv_cross::SPIRString&>(spirv_cross::SPIRString&)
Unexecuted instantiation: spirv_cross::SPIRDebugLocalVariable* spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::allocate<spirv_cross::SPIRDebugLocalVariable&>(spirv_cross::SPIRDebugLocalVariable&)
Unexecuted instantiation: spirv_cross::SPIRCombinedImageSampler* spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::allocate<spirv_cross::SPIRCombinedImageSampler&>(spirv_cross::SPIRCombinedImageSampler&)
Unexecuted instantiation: spirv_cross::SPIRConstantOp* spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::allocate<spirv_cross::SPIRConstantOp&>(spirv_cross::SPIRConstantOp&)
spirv_cross::SPIRType* spirv_cross::ObjectPool<spirv_cross::SPIRType>::allocate<spirv_cross::SPIRType&>(spirv_cross::SPIRType&)
Line
Count
Source
571
4.94k
  {
572
4.94k
    if (vacants.empty())
573
13
    {
574
13
      unsigned num_objects = start_object_count << memory.size();
575
13
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
13
      if (!ptr)
577
0
        return nullptr;
578
579
13
      vacants.reserve(num_objects);
580
429
      for (unsigned i = 0; i < num_objects; i++)
581
416
        vacants.push_back(&ptr[i]);
582
583
13
      memory.emplace_back(ptr);
584
13
    }
585
586
4.94k
    T *ptr = vacants.back();
587
4.94k
    vacants.pop_back();
588
4.94k
    new (ptr) T(std::forward<P>(p)...);
589
4.94k
    return ptr;
590
4.94k
  }
Unexecuted instantiation: spirv_cross::SPIRExtension* spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::allocate<spirv_cross::SPIRExtension&>(spirv_cross::SPIRExtension&)
Unexecuted instantiation: spirv_cross::SPIRExpression* spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::allocate<spirv_cross::SPIRExpression&>(spirv_cross::SPIRExpression&)
Unexecuted instantiation: spirv_cross::SPIRFunctionPrototype* spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::allocate<spirv_cross::SPIRFunctionPrototype&>(spirv_cross::SPIRFunctionPrototype&)
Unexecuted instantiation: spirv_cross::SPIRBlock* spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::allocate<spirv_cross::SPIRBlock&>(spirv_cross::SPIRBlock&)
Unexecuted instantiation: spirv_cross::SPIRFunction* spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::allocate<spirv_cross::SPIRFunction&>(spirv_cross::SPIRFunction&)
Unexecuted instantiation: spirv_cross::SPIRAccessChain* spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::allocate<spirv_cross::SPIRAccessChain&>(spirv_cross::SPIRAccessChain&)
Unexecuted instantiation: spirv_cross::SPIRVariable* spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::allocate<spirv_cross::SPIRVariable&>(spirv_cross::SPIRVariable&)
Unexecuted instantiation: spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<spirv_cross::SPIRConstant&>(spirv_cross::SPIRConstant&)
spirv_cross::SPIRString* spirv_cross::ObjectPool<spirv_cross::SPIRString>::allocate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&)
Line
Count
Source
571
1.04k
  {
572
1.04k
    if (vacants.empty())
573
152
    {
574
152
      unsigned num_objects = start_object_count << memory.size();
575
152
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
152
      if (!ptr)
577
0
        return nullptr;
578
579
152
      vacants.reserve(num_objects);
580
2.58k
      for (unsigned i = 0; i < num_objects; i++)
581
2.43k
        vacants.push_back(&ptr[i]);
582
583
152
      memory.emplace_back(ptr);
584
152
    }
585
586
1.04k
    T *ptr = vacants.back();
587
1.04k
    vacants.pop_back();
588
1.04k
    new (ptr) T(std::forward<P>(p)...);
589
1.04k
    return ptr;
590
1.04k
  }
spirv_cross::SPIRUndef* spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::allocate<unsigned int&>(unsigned int&)
Line
Count
Source
571
142
  {
572
142
    if (vacants.empty())
573
62
    {
574
62
      unsigned num_objects = start_object_count << memory.size();
575
62
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
62
      if (!ptr)
577
0
        return nullptr;
578
579
62
      vacants.reserve(num_objects);
580
1.05k
      for (unsigned i = 0; i < num_objects; i++)
581
992
        vacants.push_back(&ptr[i]);
582
583
62
      memory.emplace_back(ptr);
584
62
    }
585
586
142
    T *ptr = vacants.back();
587
142
    vacants.pop_back();
588
142
    new (ptr) T(std::forward<P>(p)...);
589
142
    return ptr;
590
142
  }
spirv_cross::SPIRExtension* spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::allocate<spirv_cross::SPIRExtension::Extension&>(spirv_cross::SPIRExtension::Extension&)
Line
Count
Source
571
1.49k
  {
572
1.49k
    if (vacants.empty())
573
577
    {
574
577
      unsigned num_objects = start_object_count << memory.size();
575
577
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
577
      if (!ptr)
577
0
        return nullptr;
578
579
577
      vacants.reserve(num_objects);
580
9.80k
      for (unsigned i = 0; i < num_objects; i++)
581
9.23k
        vacants.push_back(&ptr[i]);
582
583
577
      memory.emplace_back(ptr);
584
577
    }
585
586
1.49k
    T *ptr = vacants.back();
587
1.49k
    vacants.pop_back();
588
1.49k
    new (ptr) T(std::forward<P>(p)...);
589
1.49k
    return ptr;
590
1.49k
  }
spirv_cross::SPIRString* spirv_cross::ObjectPool<spirv_cross::SPIRString>::allocate<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
Line
Count
Source
571
95
  {
572
95
    if (vacants.empty())
573
0
    {
574
0
      unsigned num_objects = start_object_count << memory.size();
575
0
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
0
      if (!ptr)
577
0
        return nullptr;
578
579
0
      vacants.reserve(num_objects);
580
0
      for (unsigned i = 0; i < num_objects; i++)
581
0
        vacants.push_back(&ptr[i]);
582
583
0
      memory.emplace_back(ptr);
584
0
    }
585
586
95
    T *ptr = vacants.back();
587
95
    vacants.pop_back();
588
95
    new (ptr) T(std::forward<P>(p)...);
589
95
    return ptr;
590
95
  }
spirv_cross::SPIRDebugLocalVariable* spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::allocate<>()
Line
Count
Source
571
97
  {
572
97
    if (vacants.empty())
573
24
    {
574
24
      unsigned num_objects = start_object_count << memory.size();
575
24
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
24
      if (!ptr)
577
0
        return nullptr;
578
579
24
      vacants.reserve(num_objects);
580
408
      for (unsigned i = 0; i < num_objects; i++)
581
384
        vacants.push_back(&ptr[i]);
582
583
24
      memory.emplace_back(ptr);
584
24
    }
585
586
97
    T *ptr = vacants.back();
587
97
    vacants.pop_back();
588
97
    new (ptr) T(std::forward<P>(p)...);
589
97
    return ptr;
590
97
  }
spirv_cross::SPIRType* spirv_cross::ObjectPool<spirv_cross::SPIRType>::allocate<spv::Op&>(spv::Op&)
Line
Count
Source
571
10.0k
  {
572
10.0k
    if (vacants.empty())
573
1.15k
    {
574
1.15k
      unsigned num_objects = start_object_count << memory.size();
575
1.15k
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
1.15k
      if (!ptr)
577
0
        return nullptr;
578
579
1.15k
      vacants.reserve(num_objects);
580
20.3k
      for (unsigned i = 0; i < num_objects; i++)
581
19.1k
        vacants.push_back(&ptr[i]);
582
583
1.15k
      memory.emplace_back(ptr);
584
1.15k
    }
585
586
10.0k
    T *ptr = vacants.back();
587
10.0k
    vacants.pop_back();
588
10.0k
    new (ptr) T(std::forward<P>(p)...);
589
10.0k
    return ptr;
590
10.0k
  }
spirv_cross::SPIRFunctionPrototype* spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::allocate<unsigned int&>(unsigned int&)
Line
Count
Source
571
1.82k
  {
572
1.82k
    if (vacants.empty())
573
507
    {
574
507
      unsigned num_objects = start_object_count << memory.size();
575
507
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
507
      if (!ptr)
577
0
        return nullptr;
578
579
507
      vacants.reserve(num_objects);
580
8.61k
      for (unsigned i = 0; i < num_objects; i++)
581
8.11k
        vacants.push_back(&ptr[i]);
582
583
507
      memory.emplace_back(ptr);
584
507
    }
585
586
1.82k
    T *ptr = vacants.back();
587
1.82k
    vacants.pop_back();
588
1.82k
    new (ptr) T(std::forward<P>(p)...);
589
1.82k
    return ptr;
590
1.82k
  }
spirv_cross::SPIRVariable* spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::allocate<unsigned int&, spv::StorageClass&, unsigned int&>(unsigned int&, spv::StorageClass&, unsigned int&)
Line
Count
Source
571
3.07k
  {
572
3.07k
    if (vacants.empty())
573
545
    {
574
545
      unsigned num_objects = start_object_count << memory.size();
575
545
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
545
      if (!ptr)
577
0
        return nullptr;
578
579
545
      vacants.reserve(num_objects);
580
10.0k
      for (unsigned i = 0; i < num_objects; i++)
581
9.45k
        vacants.push_back(&ptr[i]);
582
583
545
      memory.emplace_back(ptr);
584
545
    }
585
586
3.07k
    T *ptr = vacants.back();
587
3.07k
    vacants.pop_back();
588
3.07k
    new (ptr) T(std::forward<P>(p)...);
589
3.07k
    return ptr;
590
3.07k
  }
spirv_cross::SPIRVariable* spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::allocate<unsigned int&, spv::StorageClass>(unsigned int&, spv::StorageClass&&)
Line
Count
Source
571
1.95k
  {
572
1.95k
    if (vacants.empty())
573
47
    {
574
47
      unsigned num_objects = start_object_count << memory.size();
575
47
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
47
      if (!ptr)
577
0
        return nullptr;
578
579
47
      vacants.reserve(num_objects);
580
1.19k
      for (unsigned i = 0; i < num_objects; i++)
581
1.15k
        vacants.push_back(&ptr[i]);
582
583
47
      memory.emplace_back(ptr);
584
47
    }
585
586
1.95k
    T *ptr = vacants.back();
587
1.95k
    vacants.pop_back();
588
1.95k
    new (ptr) T(std::forward<P>(p)...);
589
1.95k
    return ptr;
590
1.95k
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int const&, unsigned int*, int, bool, bool>(unsigned int const&, unsigned int*&&, int&&, bool&&, bool&&)
Line
Count
Source
571
353
  {
572
353
    if (vacants.empty())
573
20
    {
574
20
      unsigned num_objects = start_object_count << memory.size();
575
20
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
20
      if (!ptr)
577
0
        return nullptr;
578
579
20
      vacants.reserve(num_objects);
580
340
      for (unsigned i = 0; i < num_objects; i++)
581
320
        vacants.push_back(&ptr[i]);
582
583
20
      memory.emplace_back(ptr);
584
20
    }
585
586
353
    T *ptr = vacants.back();
587
353
    vacants.pop_back();
588
353
    new (ptr) T(std::forward<P>(p)...);
589
353
    return ptr;
590
353
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int const&, unsigned long, bool>(unsigned int const&, unsigned long&&, bool&&)
Line
Count
Source
571
311
  {
572
311
    if (vacants.empty())
573
51
    {
574
51
      unsigned num_objects = start_object_count << memory.size();
575
51
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
51
      if (!ptr)
577
0
        return nullptr;
578
579
51
      vacants.reserve(num_objects);
580
867
      for (unsigned i = 0; i < num_objects; i++)
581
816
        vacants.push_back(&ptr[i]);
582
583
51
      memory.emplace_back(ptr);
584
51
    }
585
586
311
    T *ptr = vacants.back();
587
311
    vacants.pop_back();
588
311
    new (ptr) T(std::forward<P>(p)...);
589
311
    return ptr;
590
311
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int const&, unsigned int const&, bool>(unsigned int const&, unsigned int const&, bool&&)
Line
Count
Source
571
3.67k
  {
572
3.67k
    if (vacants.empty())
573
433
    {
574
433
      unsigned num_objects = start_object_count << memory.size();
575
433
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
433
      if (!ptr)
577
0
        return nullptr;
578
579
433
      vacants.reserve(num_objects);
580
8.78k
      for (unsigned i = 0; i < num_objects; i++)
581
8.35k
        vacants.push_back(&ptr[i]);
582
583
433
      memory.emplace_back(ptr);
584
433
    }
585
586
3.67k
    T *ptr = vacants.back();
587
3.67k
    vacants.pop_back();
588
3.67k
    new (ptr) T(std::forward<P>(p)...);
589
3.67k
    return ptr;
590
3.67k
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int const&, unsigned int, bool>(unsigned int const&, unsigned int&&, bool&&)
Line
Count
Source
571
2.53k
  {
572
2.53k
    if (vacants.empty())
573
76
    {
574
76
      unsigned num_objects = start_object_count << memory.size();
575
76
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
76
      if (!ptr)
577
0
        return nullptr;
578
579
76
      vacants.reserve(num_objects);
580
1.30k
      for (unsigned i = 0; i < num_objects; i++)
581
1.23k
        vacants.push_back(&ptr[i]);
582
583
76
      memory.emplace_back(ptr);
584
76
    }
585
586
2.53k
    T *ptr = vacants.back();
587
2.53k
    vacants.pop_back();
588
2.53k
    new (ptr) T(std::forward<P>(p)...);
589
2.53k
    return ptr;
590
2.53k
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int&, unsigned int const*, unsigned int, bool>(unsigned int&, unsigned int const*&&, unsigned int&&, bool&&)
Line
Count
Source
571
159
  {
572
159
    if (vacants.empty())
573
6
    {
574
6
      unsigned num_objects = start_object_count << memory.size();
575
6
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
6
      if (!ptr)
577
0
        return nullptr;
578
579
6
      vacants.reserve(num_objects);
580
102
      for (unsigned i = 0; i < num_objects; i++)
581
96
        vacants.push_back(&ptr[i]);
582
583
6
      memory.emplace_back(ptr);
584
6
    }
585
586
159
    T *ptr = vacants.back();
587
159
    vacants.pop_back();
588
159
    new (ptr) T(std::forward<P>(p)...);
589
159
    return ptr;
590
159
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int&, spirv_cross::SPIRConstant const* (&) [4], unsigned int&, bool>(unsigned int&, spirv_cross::SPIRConstant const* (&) [4], unsigned int&, bool&&)
Line
Count
Source
571
4.20k
  {
572
4.20k
    if (vacants.empty())
573
15
    {
574
15
      unsigned num_objects = start_object_count << memory.size();
575
15
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
15
      if (!ptr)
577
0
        return nullptr;
578
579
15
      vacants.reserve(num_objects);
580
479
      for (unsigned i = 0; i < num_objects; i++)
581
464
        vacants.push_back(&ptr[i]);
582
583
15
      memory.emplace_back(ptr);
584
15
    }
585
586
4.20k
    T *ptr = vacants.back();
587
4.20k
    vacants.pop_back();
588
4.20k
    new (ptr) T(std::forward<P>(p)...);
589
4.20k
    return ptr;
590
4.20k
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int&>(unsigned int&)
Line
Count
Source
571
100k
  {
572
100k
    if (vacants.empty())
573
143
    {
574
143
      unsigned num_objects = start_object_count << memory.size();
575
143
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
143
      if (!ptr)
577
0
        return nullptr;
578
579
143
      vacants.reserve(num_objects);
580
8.59k
      for (unsigned i = 0; i < num_objects; i++)
581
8.44k
        vacants.push_back(&ptr[i]);
582
583
143
      memory.emplace_back(ptr);
584
143
    }
585
586
100k
    T *ptr = vacants.back();
587
100k
    vacants.pop_back();
588
100k
    new (ptr) T(std::forward<P>(p)...);
589
100k
    return ptr;
590
100k
  }
spirv_cross::SPIRType* spirv_cross::ObjectPool<spirv_cross::SPIRType>::allocate<spv::Op>(spv::Op&&)
Line
Count
Source
571
73
  {
572
73
    if (vacants.empty())
573
18
    {
574
18
      unsigned num_objects = start_object_count << memory.size();
575
18
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
18
      if (!ptr)
577
0
        return nullptr;
578
579
18
      vacants.reserve(num_objects);
580
466
      for (unsigned i = 0; i < num_objects; i++)
581
448
        vacants.push_back(&ptr[i]);
582
583
18
      memory.emplace_back(ptr);
584
18
    }
585
586
73
    T *ptr = vacants.back();
587
73
    vacants.pop_back();
588
73
    new (ptr) T(std::forward<P>(p)...);
589
73
    return ptr;
590
73
  }
spirv_cross::SPIRFunction* spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::allocate<unsigned int&, unsigned int&>(unsigned int&, unsigned int&)
Line
Count
Source
571
2.04k
  {
572
2.04k
    if (vacants.empty())
573
539
    {
574
539
      unsigned num_objects = start_object_count << memory.size();
575
539
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
539
      if (!ptr)
577
0
        return nullptr;
578
579
539
      vacants.reserve(num_objects);
580
9.16k
      for (unsigned i = 0; i < num_objects; i++)
581
8.62k
        vacants.push_back(&ptr[i]);
582
583
539
      memory.emplace_back(ptr);
584
539
    }
585
586
2.04k
    T *ptr = vacants.back();
587
2.04k
    vacants.pop_back();
588
2.04k
    new (ptr) T(std::forward<P>(p)...);
589
2.04k
    return ptr;
590
2.04k
  }
spirv_cross::SPIRBlock* spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::allocate<>()
Line
Count
Source
571
11.7k
  {
572
11.7k
    if (vacants.empty())
573
610
    {
574
610
      unsigned num_objects = start_object_count << memory.size();
575
610
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
610
      if (!ptr)
577
0
        return nullptr;
578
579
610
      vacants.reserve(num_objects);
580
12.8k
      for (unsigned i = 0; i < num_objects; i++)
581
12.2k
        vacants.push_back(&ptr[i]);
582
583
610
      memory.emplace_back(ptr);
584
610
    }
585
586
11.7k
    T *ptr = vacants.back();
587
11.7k
    vacants.pop_back();
588
11.7k
    new (ptr) T(std::forward<P>(p)...);
589
11.7k
    return ptr;
590
11.7k
  }
spirv_cross::SPIRConstantOp* spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::allocate<unsigned int&, spv::Op&, unsigned int const*, unsigned int>(unsigned int&, spv::Op&, unsigned int const*&&, unsigned int&&)
Line
Count
Source
571
416
  {
572
416
    if (vacants.empty())
573
40
    {
574
40
      unsigned num_objects = start_object_count << memory.size();
575
40
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
40
      if (!ptr)
577
0
        return nullptr;
578
579
40
      vacants.reserve(num_objects);
580
680
      for (unsigned i = 0; i < num_objects; i++)
581
640
        vacants.push_back(&ptr[i]);
582
583
40
      memory.emplace_back(ptr);
584
40
    }
585
586
416
    T *ptr = vacants.back();
587
416
    vacants.pop_back();
588
416
    new (ptr) T(std::forward<P>(p)...);
589
416
    return ptr;
590
416
  }
spirv_cross::SPIRConstant* spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::allocate<unsigned int&, unsigned int*, unsigned int, bool>(unsigned int&, unsigned int*&&, unsigned int&&, bool&&)
Line
Count
Source
571
96.7k
  {
572
96.7k
    if (vacants.empty())
573
191
    {
574
191
      unsigned num_objects = start_object_count << memory.size();
575
191
      T *ptr = static_cast<T *>(malloc(num_objects * sizeof(T)));
576
191
      if (!ptr)
577
0
        return nullptr;
578
579
191
      vacants.reserve(num_objects);
580
168k
      for (unsigned i = 0; i < num_objects; i++)
581
168k
        vacants.push_back(&ptr[i]);
582
583
191
      memory.emplace_back(ptr);
584
191
    }
585
586
96.7k
    T *ptr = vacants.back();
587
96.7k
    vacants.pop_back();
588
96.7k
    new (ptr) T(std::forward<P>(p)...);
589
96.7k
    return ptr;
590
96.7k
  }
591
592
  void deallocate(T *ptr)
593
247k
  {
594
247k
    ptr->~T();
595
247k
    vacants.push_back(ptr);
596
247k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRType>::deallocate(spirv_cross::SPIRType*)
Line
Count
Source
593
15.0k
  {
594
15.0k
    ptr->~T();
595
15.0k
    vacants.push_back(ptr);
596
15.0k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::deallocate(spirv_cross::SPIRVariable*)
Line
Count
Source
593
5.03k
  {
594
5.03k
    ptr->~T();
595
5.03k
    vacants.push_back(ptr);
596
5.03k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::deallocate(spirv_cross::SPIRConstant*)
Line
Count
Source
593
208k
  {
594
208k
    ptr->~T();
595
208k
    vacants.push_back(ptr);
596
208k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::deallocate(spirv_cross::SPIRFunction*)
Line
Count
Source
593
2.04k
  {
594
2.04k
    ptr->~T();
595
2.04k
    vacants.push_back(ptr);
596
2.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::deallocate(spirv_cross::SPIRFunctionPrototype*)
Line
Count
Source
593
1.82k
  {
594
1.82k
    ptr->~T();
595
1.82k
    vacants.push_back(ptr);
596
1.82k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::deallocate(spirv_cross::SPIRBlock*)
Line
Count
Source
593
11.7k
  {
594
11.7k
    ptr->~T();
595
11.7k
    vacants.push_back(ptr);
596
11.7k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::deallocate(spirv_cross::SPIRExtension*)
Line
Count
Source
593
1.49k
  {
594
1.49k
    ptr->~T();
595
1.49k
    vacants.push_back(ptr);
596
1.49k
  }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::deallocate(spirv_cross::SPIRExpression*)
spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::deallocate(spirv_cross::SPIRConstantOp*)
Line
Count
Source
593
416
  {
594
416
    ptr->~T();
595
416
    vacants.push_back(ptr);
596
416
  }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::deallocate(spirv_cross::SPIRCombinedImageSampler*)
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::deallocate(spirv_cross::SPIRAccessChain*)
spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::deallocate(spirv_cross::SPIRUndef*)
Line
Count
Source
593
142
  {
594
142
    ptr->~T();
595
142
    vacants.push_back(ptr);
596
142
  }
spirv_cross::ObjectPool<spirv_cross::SPIRString>::deallocate(spirv_cross::SPIRString*)
Line
Count
Source
593
1.14k
  {
594
1.14k
    ptr->~T();
595
1.14k
    vacants.push_back(ptr);
596
1.14k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::deallocate(spirv_cross::SPIRDebugLocalVariable*)
Line
Count
Source
593
97
  {
594
97
    ptr->~T();
595
97
    vacants.push_back(ptr);
596
97
  }
597
598
  void deallocate_opaque(void *ptr) override
599
247k
  {
600
247k
    deallocate(static_cast<T *>(ptr));
601
247k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRType>::deallocate_opaque(void*)
Line
Count
Source
599
15.0k
  {
600
15.0k
    deallocate(static_cast<T *>(ptr));
601
15.0k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::deallocate_opaque(void*)
Line
Count
Source
599
5.03k
  {
600
5.03k
    deallocate(static_cast<T *>(ptr));
601
5.03k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::deallocate_opaque(void*)
Line
Count
Source
599
208k
  {
600
208k
    deallocate(static_cast<T *>(ptr));
601
208k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::deallocate_opaque(void*)
Line
Count
Source
599
2.04k
  {
600
2.04k
    deallocate(static_cast<T *>(ptr));
601
2.04k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::deallocate_opaque(void*)
Line
Count
Source
599
1.82k
  {
600
1.82k
    deallocate(static_cast<T *>(ptr));
601
1.82k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::deallocate_opaque(void*)
Line
Count
Source
599
11.7k
  {
600
11.7k
    deallocate(static_cast<T *>(ptr));
601
11.7k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::deallocate_opaque(void*)
Line
Count
Source
599
1.49k
  {
600
1.49k
    deallocate(static_cast<T *>(ptr));
601
1.49k
  }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::deallocate_opaque(void*)
spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::deallocate_opaque(void*)
Line
Count
Source
599
416
  {
600
416
    deallocate(static_cast<T *>(ptr));
601
416
  }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::deallocate_opaque(void*)
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::deallocate_opaque(void*)
spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::deallocate_opaque(void*)
Line
Count
Source
599
142
  {
600
142
    deallocate(static_cast<T *>(ptr));
601
142
  }
spirv_cross::ObjectPool<spirv_cross::SPIRString>::deallocate_opaque(void*)
Line
Count
Source
599
1.14k
  {
600
1.14k
    deallocate(static_cast<T *>(ptr));
601
1.14k
  }
spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::deallocate_opaque(void*)
Line
Count
Source
599
97
  {
600
97
    deallocate(static_cast<T *>(ptr));
601
97
  }
602
603
  void clear()
604
  {
605
    vacants.clear();
606
    memory.clear();
607
  }
608
609
protected:
610
  Vector<T *> vacants;
611
612
  struct MallocDeleter
613
  {
614
    void operator()(T *ptr)
615
5.21k
    {
616
5.21k
      ::free(ptr);
617
5.21k
    }
spirv_cross::ObjectPool<spirv_cross::SPIRUndef>::MallocDeleter::operator()(spirv_cross::SPIRUndef*)
Line
Count
Source
615
62
    {
616
62
      ::free(ptr);
617
62
    }
spirv_cross::ObjectPool<spirv_cross::SPIRString>::MallocDeleter::operator()(spirv_cross::SPIRString*)
Line
Count
Source
615
152
    {
616
152
      ::free(ptr);
617
152
    }
spirv_cross::ObjectPool<spirv_cross::SPIRDebugLocalVariable>::MallocDeleter::operator()(spirv_cross::SPIRDebugLocalVariable*)
Line
Count
Source
615
24
    {
616
24
      ::free(ptr);
617
24
    }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRCombinedImageSampler>::MallocDeleter::operator()(spirv_cross::SPIRCombinedImageSampler*)
spirv_cross::ObjectPool<spirv_cross::SPIRConstantOp>::MallocDeleter::operator()(spirv_cross::SPIRConstantOp*)
Line
Count
Source
615
40
    {
616
40
      ::free(ptr);
617
40
    }
spirv_cross::ObjectPool<spirv_cross::SPIRType>::MallocDeleter::operator()(spirv_cross::SPIRType*)
Line
Count
Source
615
1.18k
    {
616
1.18k
      ::free(ptr);
617
1.18k
    }
spirv_cross::ObjectPool<spirv_cross::SPIRExtension>::MallocDeleter::operator()(spirv_cross::SPIRExtension*)
Line
Count
Source
615
577
    {
616
577
      ::free(ptr);
617
577
    }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRExpression>::MallocDeleter::operator()(spirv_cross::SPIRExpression*)
spirv_cross::ObjectPool<spirv_cross::SPIRFunctionPrototype>::MallocDeleter::operator()(spirv_cross::SPIRFunctionPrototype*)
Line
Count
Source
615
507
    {
616
507
      ::free(ptr);
617
507
    }
spirv_cross::ObjectPool<spirv_cross::SPIRBlock>::MallocDeleter::operator()(spirv_cross::SPIRBlock*)
Line
Count
Source
615
610
    {
616
610
      ::free(ptr);
617
610
    }
spirv_cross::ObjectPool<spirv_cross::SPIRFunction>::MallocDeleter::operator()(spirv_cross::SPIRFunction*)
Line
Count
Source
615
539
    {
616
539
      ::free(ptr);
617
539
    }
Unexecuted instantiation: spirv_cross::ObjectPool<spirv_cross::SPIRAccessChain>::MallocDeleter::operator()(spirv_cross::SPIRAccessChain*)
spirv_cross::ObjectPool<spirv_cross::SPIRVariable>::MallocDeleter::operator()(spirv_cross::SPIRVariable*)
Line
Count
Source
615
592
    {
616
592
      ::free(ptr);
617
592
    }
spirv_cross::ObjectPool<spirv_cross::SPIRConstant>::MallocDeleter::operator()(spirv_cross::SPIRConstant*)
Line
Count
Source
615
935
    {
616
935
      ::free(ptr);
617
935
    }
618
  };
619
620
  SmallVector<std::unique_ptr<T, MallocDeleter>> memory;
621
  unsigned start_object_count;
622
};
623
624
template <size_t StackSize = 4096, size_t BlockSize = 4096>
625
class StringStream
626
{
627
public:
628
  StringStream()
629
  {
630
    reset();
631
  }
632
633
  ~StringStream()
634
  {
635
    reset();
636
  }
637
638
  // Disable copies and moves. Makes it easier to implement, and we don't need it.
639
  StringStream(const StringStream &) = delete;
640
  void operator=(const StringStream &) = delete;
641
642
  template <typename T, typename std::enable_if<!std::is_floating_point<T>::value, int>::type = 0>
643
  StringStream &operator<<(const T &t)
644
  {
645
    auto s = std::to_string(t);
646
    append(s.data(), s.size());
647
    return *this;
648
  }
649
650
  // Only overload this to make float/double conversions ambiguous.
651
  StringStream &operator<<(uint32_t v)
652
  {
653
    auto s = std::to_string(v);
654
    append(s.data(), s.size());
655
    return *this;
656
  }
657
658
  StringStream &operator<<(char c)
659
  {
660
    append(&c, 1);
661
    return *this;
662
  }
663
664
  StringStream &operator<<(const std::string &s)
665
0
  {
666
0
    append(s.data(), s.size());
667
0
    return *this;
668
0
  }
669
670
  StringStream &operator<<(const char *s)
671
0
  {
672
0
    append(s, strlen(s));
673
0
    return *this;
674
0
  }
675
676
  template <size_t N>
677
  StringStream &operator<<(const char (&s)[N])
678
  {
679
    append(s, strlen(s));
680
    return *this;
681
  }
682
683
  std::string str() const
684
0
  {
685
0
    std::string ret;
686
0
    size_t target_size = 0;
687
0
    for (auto &saved : saved_buffers)
688
0
      target_size += saved.offset;
689
0
    target_size += current_buffer.offset;
690
0
    ret.reserve(target_size);
691
0
692
0
    for (auto &saved : saved_buffers)
693
0
      ret.insert(ret.end(), saved.buffer, saved.buffer + saved.offset);
694
0
    ret.insert(ret.end(), current_buffer.buffer, current_buffer.buffer + current_buffer.offset);
695
0
    return ret;
696
0
  }
697
698
  void reset()
699
0
  {
700
0
    for (auto &saved : saved_buffers)
701
0
      if (saved.buffer != stack_buffer)
702
0
        free(saved.buffer);
703
0
    if (current_buffer.buffer != stack_buffer)
704
0
      free(current_buffer.buffer);
705
0
706
0
    saved_buffers.clear();
707
0
    current_buffer.buffer = stack_buffer;
708
0
    current_buffer.offset = 0;
709
0
    current_buffer.size = sizeof(stack_buffer);
710
0
  }
711
712
private:
713
  struct Buffer
714
  {
715
    char *buffer = nullptr;
716
    size_t offset = 0;
717
    size_t size = 0;
718
  };
719
  Buffer current_buffer;
720
  char stack_buffer[StackSize];
721
  SmallVector<Buffer> saved_buffers;
722
723
  void append(const char *s, size_t len)
724
0
  {
725
0
    size_t avail = current_buffer.size - current_buffer.offset;
726
0
    if (avail < len)
727
0
    {
728
0
      if (avail > 0)
729
0
      {
730
0
        memcpy(current_buffer.buffer + current_buffer.offset, s, avail);
731
0
        s += avail;
732
0
        len -= avail;
733
0
        current_buffer.offset += avail;
734
0
      }
735
0
736
0
      saved_buffers.push_back(current_buffer);
737
0
      size_t target_size = len > BlockSize ? len : BlockSize;
738
0
      current_buffer.buffer = static_cast<char *>(malloc(target_size));
739
0
      if (!current_buffer.buffer)
740
0
        SPIRV_CROSS_THROW("Out of memory.");
741
0
742
0
      memcpy(current_buffer.buffer, s, len);
743
0
      current_buffer.offset = len;
744
0
      current_buffer.size = target_size;
745
0
    }
746
0
    else
747
0
    {
748
0
      memcpy(current_buffer.buffer + current_buffer.offset, s, len);
749
0
      current_buffer.offset += len;
750
0
    }
751
0
  }
752
};
753
754
} // namespace SPIRV_CROSS_NAMESPACE
755
756
#endif