/src/boringssl/crypto/mem_internal.h
Line | Count | Source |
1 | | // Copyright 2025 The BoringSSL Authors |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |
16 | | #define OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |
17 | | |
18 | | #include <openssl/mem.h> |
19 | | |
20 | | #include <algorithm> |
21 | | #include <memory> |
22 | | #include <type_traits> |
23 | | #include <utility> |
24 | | |
25 | | #include <openssl/err.h> |
26 | | #include <openssl/span.h> |
27 | | |
28 | | #include "internal.h" |
29 | | |
30 | | |
31 | | BSSL_NAMESPACE_BEGIN |
32 | | |
33 | | // Internal allocation-dependent functions. |
34 | | // |
35 | | // This header is separate from crypto/internal.h because there are some files |
36 | | // which must avoid `OPENSSL_malloc`, to avoid a circular dependency, but |
37 | | // need other support routines in crypto/internal.h. (See |
38 | | // `_BORINGSSL_PROHIBIT_OPENSSL_MALLOC`.) |
39 | | |
40 | | |
41 | | // Memory allocation. |
42 | | |
43 | | // New behaves like `new` but uses `OPENSSL_malloc` for memory allocation. It |
44 | | // returns nullptr on allocation error. It only implements single-object |
45 | | // allocation and not new T[n]. |
46 | | // |
47 | | // When called with no arguments, it performs value-initialization, not |
48 | | // default-initialization. This means that, if it selects a non-user-provided |
49 | | // constructor, the object will be zero-initialized. (As in any C++ type, once |
50 | | // `T` gains a user-provided constructor, it is responsible for initializing |
51 | | // all fields explicitly.) |
52 | | // |
53 | | // Note: unlike `new`, this does not support non-public constructors. |
54 | | template <typename T, typename... Args> |
55 | 12.0M | T *New(Args &&...args) { |
56 | 12.0M | void *t = OPENSSL_malloc(sizeof(T)); |
57 | 12.0M | if (t == nullptr) { |
58 | 0 | return nullptr; |
59 | 0 | } |
60 | 12.0M | return new (t) T(std::forward<Args>(args)...); |
61 | 12.0M | } Unexecuted instantiation: bssl::ECHConfig* bssl::New<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) bssl::SSLECHKeys* bssl::New<bssl::SSLECHKeys>() Line | Count | Source | 55 | 14.9k | T *New(Args &&...args) { | 56 | 14.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.9k | } |
bssl::ECHServerConfig* bssl::New<bssl::ECHServerConfig>() Line | Count | Source | 55 | 12.8k | T *New(Args &&...args) { | 56 | 12.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 12.8k | } |
bssl::SSLPAKEShare* bssl::New<bssl::SSLPAKEShare>() Line | Count | Source | 55 | 44 | T *New(Args &&...args) { | 56 | 44 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 44 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 44 | return new (t) T(std::forward<Args>(args)...); | 61 | 44 | } |
Unexecuted instantiation: bssl::spake2plus::Prover* bssl::New<bssl::spake2plus::Prover>() bssl::SSLCipherPreferenceList* bssl::New<bssl::SSLCipherPreferenceList>() Line | Count | Source | 55 | 19.7k | T *New(Args &&...args) { | 56 | 19.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 19.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 19.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 19.7k | } |
bssl::SSL_HANDSHAKE_HINTS* bssl::New<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 55 | 77.4k | T *New(Args &&...args) { | 56 | 77.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 77.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 77.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 77.4k | } |
bssl::SSL_HANDSHAKE* bssl::New<bssl::SSL_HANDSHAKE, bssl::SSLImpl*&>(bssl::SSLImpl*&) Line | Count | Source | 55 | 97.2k | T *New(Args &&...args) { | 56 | 97.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 97.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 97.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 97.2k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 55 | 133k | T *New(Args &&...args) { | 56 | 133k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 133k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 133k | return new (t) T(std::forward<Args>(args)...); | 61 | 133k | } |
bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 55 | 63.8k | T *New(Args &&...args) { | 56 | 63.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 63.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 63.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 63.8k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
Unexecuted instantiation: bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::ECKeyShare* bssl::New<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 55 | 14.1k | T *New(Args &&...args) { | 56 | 14.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.1k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519KeyShare* bssl::New<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 55 | 84.5k | T *New(Args &&...args) { | 56 | 84.5k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 84.5k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 84.5k | return new (t) T(std::forward<Args>(args)...); | 61 | 84.5k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519MLKEM768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 55 | 52.1k | T *New(Args &&...args) { | 56 | 52.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 52.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 52.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 52.1k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::MLKEM1024KeyShare* bssl::New<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 55 | 25 | T *New(Args &&...args) { | 56 | 25 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 25 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 25 | return new (t) T(std::forward<Args>(args)...); | 61 | 25 | } |
bssl::SSLContext* bssl::New<bssl::SSLContext, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 55 | 4.98k | T *New(Args &&...args) { | 56 | 4.98k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 4.98k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 4.98k | return new (t) T(std::forward<Args>(args)...); | 61 | 4.98k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 55 | 4.98k | T *New(Args &&...args) { | 56 | 4.98k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 4.98k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 4.98k | return new (t) T(std::forward<Args>(args)...); | 61 | 4.98k | } |
bssl::SSLImpl* bssl::New<bssl::SSLImpl, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::SSL_CONFIG* bssl::New<bssl::SSL_CONFIG, bssl::SSLImpl*>(bssl::SSLImpl*&&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::TicketKey* bssl::New<bssl::TicketKey>() Line | Count | Source | 55 | 473 | T *New(Args &&...args) { | 56 | 473 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 473 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 473 | return new (t) T(std::forward<Args>(args)...); | 61 | 473 | } |
bssl::SSLSession* bssl::New<bssl::SSLSession, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 252k | T *New(Args &&...args) { | 56 | 252k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 252k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 252k | return new (t) T(std::forward<Args>(args)...); | 61 | 252k | } |
tls13_enc.cc:bssl::(anonymous namespace)::NullRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 55 | 41.4k | T *New(Args &&...args) { | 56 | 41.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 41.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 41.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 41.4k | } |
Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES128RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES256RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: bssl::spake2plus::Verifier* bssl::New<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter>&&) Line | Count | Source | 55 | 308 | T *New(Args &&...args) { | 56 | 308 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 308 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 308 | return new (t) T(std::forward<Args>(args)...); | 61 | 308 | } |
bssl::DTLSIncomingMessage* bssl::New<bssl::DTLSIncomingMessage, bssl::DTLSHandshakeHeader const&>(bssl::DTLSHandshakeHeader const&) Line | Count | Source | 55 | 49.9k | T *New(Args &&...args) { | 56 | 49.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 49.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 49.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 49.9k | } |
bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>* bssl::New<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 55 | 10.8k | T *New(Args &&...args) { | 56 | 10.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 10.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 10.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 10.8k | } |
bssl::DTLS1_STATE* bssl::New<bssl::DTLS1_STATE>() Line | Count | Source | 55 | 18.0k | T *New(Args &&...args) { | 56 | 18.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 18.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 18.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 18.0k | } |
bssl::DTLSPrevReadEpoch* bssl::New<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 55 | 31.7k | T *New(Args &&...args) { | 56 | 31.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 31.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 31.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 31.7k | } |
bssl::SSL3_STATE* bssl::New<bssl::SSL3_STATE>() Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::EC_WRAPPED_SCALAR* bssl::New<bssl::EC_WRAPPED_SCALAR>() Line | Count | Source | 55 | 3.52k | T *New(Args &&...args) { | 56 | 3.52k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 3.52k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 3.52k | return new (t) T(std::forward<Args>(args)...); | 61 | 3.52k | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::keygen_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>() Line | Count | Source | 55 | 339 | T *New(Args &&...args) { | 56 | 339 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 339 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 339 | return new (t) T(std::forward<Args>(args)...); | 61 | 339 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::sign_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::verify_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>() bignum_st* bssl::New<bignum_st>() Line | Count | Source | 55 | 671k | T *New(Args &&...args) { | 56 | 671k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 671k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 671k | return new (t) T(std::forward<Args>(args)...); | 61 | 671k | } |
bssl::BignumCtx* bssl::New<bssl::BignumCtx>() Line | Count | Source | 55 | 67.0k | T *New(Args &&...args) { | 56 | 67.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 67.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 67.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 67.0k | } |
bn_mont_ctx_st* bssl::New<bn_mont_ctx_st>() Line | Count | Source | 55 | 24.3k | T *New(Args &&...args) { | 56 | 24.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 24.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 24.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 24.3k | } |
Unexecuted instantiation: bn_gencb_st* bssl::New<bn_gencb_st>() Unexecuted instantiation: evp_aead_ctx_st* bssl::New<evp_aead_ctx_st>() Unexecuted instantiation: evp_cipher_ctx_st* bssl::New<evp_cipher_ctx_st>() Unexecuted instantiation: cmac_ctx_st* bssl::New<cmac_ctx_st>() Unexecuted instantiation: bssl::DHImpl* bssl::New<bssl::DHImpl>() Unexecuted instantiation: env_md_ctx_st* bssl::New<env_md_ctx_st>() Unexecuted instantiation: bssl::ECCustomGroup* bssl::New<bssl::ECCustomGroup, ec_method_st const*>(ec_method_st const*&&) ec_point_st* bssl::New<ec_point_st>() Line | Count | Source | 55 | 148k | T *New(Args &&...args) { | 56 | 148k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 148k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 148k | return new (t) T(std::forward<Args>(args)...); | 61 | 148k | } |
bssl::ECKey* bssl::New<bssl::ECKey, engine_st const*&>(engine_st const*&) Line | Count | Source | 55 | 64.1k | T *New(Args &&...args) { | 56 | 64.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 64.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 64.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 64.1k | } |
hmac_ctx_st* bssl::New<hmac_ctx_st>() Line | Count | Source | 55 | 26.4k | T *New(Args &&...args) { | 56 | 26.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 26.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 26.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 26.4k | } |
bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>() Line | Count | Source | 55 | 302 | T *New(Args &&...args) { | 56 | 302 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 302 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 302 | return new (t) T(std::forward<Args>(args)...); | 61 | 302 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>() Line | Count | Source | 55 | 161 | T *New(Args &&...args) { | 56 | 161 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 161 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 161 | return new (t) T(std::forward<Args>(args)...); | 61 | 161 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: ctr_drbg_state_st* bssl::New<ctr_drbg_state_st>() bcm.cc:(anonymous namespace)::rand_thread_state* bssl::New<(anonymous namespace)::rand_thread_state>() Line | Count | Source | 55 | 8 | T *New(Args &&...args) { | 56 | 8 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 8 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 8 | return new (t) T(std::forward<Args>(args)...); | 61 | 8 | } |
bssl::RSAImpl* bssl::New<bssl::RSAImpl, engine_st const*&>(engine_st const*&) Line | Count | Source | 55 | 146k | T *New(Args &&...args) { | 56 | 146k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 146k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 146k | return new (t) T(std::forward<Args>(args)...); | 61 | 146k | } |
bssl::Bio* bssl::New<bssl::Bio, bio_method_st const*&>(bio_method_st const*&) Line | Count | Source | 55 | 77.6k | T *New(Args &&...args) { | 56 | 77.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 77.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 77.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 77.6k | } |
bio_method_st* bssl::New<bio_method_st>() Line | Count | Source | 55 | 6 | T *New(Args &&...args) { | 56 | 6 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6 | return new (t) T(std::forward<Args>(args)...); | 61 | 6 | } |
buf_mem_st* bssl::New<buf_mem_st>() Line | Count | Source | 55 | 525k | T *New(Args &&...args) { | 56 | 525k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 525k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 525k | return new (t) T(std::forward<Args>(args)...); | 61 | 525k | } |
ecdsa_sig_st* bssl::New<ecdsa_sig_st>() Line | Count | Source | 55 | 21.1k | T *New(Args &&...args) { | 56 | 21.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 21.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 21.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 21.1k | } |
Unexecuted instantiation: engine_st* bssl::New<engine_st>() bssl::EvpPkey* bssl::New<bssl::EvpPkey>() Line | Count | Source | 55 | 272k | T *New(Args &&...args) { | 56 | 272k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 272k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 272k | return new (t) T(std::forward<Args>(args)...); | 61 | 272k | } |
bssl::EvpPkeyCtx* bssl::New<bssl::EvpPkeyCtx>() Line | Count | Source | 55 | 119k | T *New(Args &&...args) { | 56 | 119k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 119k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 119k | return new (t) T(std::forward<Args>(args)...); | 61 | 119k | } |
Unexecuted instantiation: p_dh.cc:(anonymous namespace)::DH_PKEY_CTX* bssl::New<(anonymous namespace)::DH_PKEY_CTX>() p_ec.cc:(anonymous namespace)::EC_PKEY_CTX* bssl::New<(anonymous namespace)::EC_PKEY_CTX>() Line | Count | Source | 55 | 38.3k | T *New(Args &&...args) { | 56 | 38.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 38.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 38.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 38.3k | } |
p_ed25519.cc:(anonymous namespace)::ED25519_KEY* bssl::New<(anonymous namespace)::ED25519_KEY>() Line | Count | Source | 55 | 278 | T *New(Args &&...args) { | 56 | 278 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 278 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 278 | return new (t) T(std::forward<Args>(args)...); | 61 | 278 | } |
Unexecuted instantiation: p_hkdf.cc:(anonymous namespace)::HKDF_PKEY_CTX* bssl::New<(anonymous namespace)::HKDF_PKEY_CTX>() Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, MLDSA44_public_key const&>(MLDSA44_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 55 | 186 | T *New(Args &&...args) { | 56 | 186 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 186 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 186 | return new (t) T(std::forward<Args>(args)...); | 61 | 186 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 55 | 17 | T *New(Args &&...args) { | 56 | 17 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 17 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 17 | return new (t) T(std::forward<Args>(args)...); | 61 | 17 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::MldsaPkeyCtx* bssl::New<(anonymous namespace)::MldsaPkeyCtx>() Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, MLDSA65_public_key const&>(MLDSA65_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 377 | T *New(Args &&...args) { | 56 | 377 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 377 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 377 | return new (t) T(std::forward<Args>(args)...); | 61 | 377 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 13 | T *New(Args &&...args) { | 56 | 13 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 13 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 13 | return new (t) T(std::forward<Args>(args)...); | 61 | 13 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, MLDSA87_public_key const&>(MLDSA87_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 55 | 341 | T *New(Args &&...args) { | 56 | 341 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 341 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 341 | return new (t) T(std::forward<Args>(args)...); | 61 | 341 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 55 | 17 | T *New(Args &&...args) { | 56 | 17 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 17 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 17 | return new (t) T(std::forward<Args>(args)...); | 61 | 17 | } |
Unexecuted instantiation: p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, MLKEM768_public_key const&>(MLKEM768_public_key const&) p_mlkem.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 85 | T *New(Args &&...args) { | 56 | 85 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 85 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 85 | return new (t) T(std::forward<Args>(args)...); | 61 | 85 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 260 | T *New(Args &&...args) { | 56 | 260 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 260 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 260 | return new (t) T(std::forward<Args>(args)...); | 61 | 260 | } |
Unexecuted instantiation: p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, MLKEM1024_public_key const&>(MLKEM1024_public_key const&) p_mlkem.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 55 | 87 | T *New(Args &&...args) { | 56 | 87 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 87 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 87 | return new (t) T(std::forward<Args>(args)...); | 61 | 87 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 55 | 131 | T *New(Args &&...args) { | 56 | 131 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 131 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 131 | return new (t) T(std::forward<Args>(args)...); | 61 | 131 | } |
p_rsa.cc:(anonymous namespace)::RSA_PKEY_CTX* bssl::New<(anonymous namespace)::RSA_PKEY_CTX>() Line | Count | Source | 55 | 80.9k | T *New(Args &&...args) { | 56 | 80.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 80.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 80.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 80.9k | } |
p_x25519.cc:(anonymous namespace)::X25519_KEY* bssl::New<(anonymous namespace)::X25519_KEY>() Line | Count | Source | 55 | 529 | T *New(Args &&...args) { | 56 | 529 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 529 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 529 | return new (t) T(std::forward<Args>(args)...); | 61 | 529 | } |
Unexecuted instantiation: bssl::ExDataFuncs* bssl::New<bssl::ExDataFuncs>() Unexecuted instantiation: evp_hpke_key_st* bssl::New<evp_hpke_key_st>() Unexecuted instantiation: evp_hpke_ctx_st* bssl::New<evp_hpke_ctx_st>() bssl::_LHASH* bssl::New<bssl::_LHASH>() Line | Count | Source | 55 | 30.9k | T *New(Args &&...args) { | 56 | 30.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 30.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 30.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 30.9k | } |
bssl::LHASH_ITEM* bssl::New<bssl::LHASH_ITEM>() Line | Count | Source | 55 | 90.2k | T *New(Args &&...args) { | 56 | 90.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 90.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 90.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 90.2k | } |
Unexecuted instantiation: bssl::CryptoBufferPool* bssl::New<bssl::CryptoBufferPool>() Unexecuted instantiation: bssl::CryptoBufferPoolHandle* bssl::New<bssl::CryptoBufferPoolHandle, bssl::CryptoBufferPool*>(bssl::CryptoBufferPool*&&) bssl::CryptoBuffer* bssl::New<bssl::CryptoBuffer>() Line | Count | Source | 55 | 351k | T *New(Args &&...args) { | 56 | 351k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 351k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 351k | return new (t) T(std::forward<Args>(args)...); | 61 | 351k | } |
stack_st* bssl::New<stack_st>() Line | Count | Source | 55 | 1.37M | T *New(Args &&...args) { | 56 | 1.37M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.37M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.37M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.37M | } |
Unexecuted instantiation: x509_lookup_st* bssl::New<x509_lookup_st>() bssl::X509Store* bssl::New<bssl::X509Store>() Line | Count | Source | 55 | 4.98k | T *New(Args &&...args) { | 56 | 4.98k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 4.98k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 4.98k | return new (t) T(std::forward<Args>(args)...); | 61 | 4.98k | } |
Unexecuted instantiation: x509_object_st* bssl::New<x509_object_st>() x509_store_ctx_st* bssl::New<x509_store_ctx_st>() Line | Count | Source | 55 | 7.85k | T *New(Args &&...args) { | 56 | 7.85k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 7.85k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 7.85k | return new (t) T(std::forward<Args>(args)...); | 61 | 7.85k | } |
X509_VERIFY_PARAM_st* bssl::New<X509_VERIFY_PARAM_st>() Line | Count | Source | 55 | 76.6k | T *New(Args &&...args) { | 56 | 76.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 76.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 76.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 76.6k | } |
Unexecuted instantiation: X509_algor_st* bssl::New<X509_algor_st>() bssl::X509NameEntry* bssl::New<bssl::X509NameEntry>() Line | Count | Source | 55 | 992k | T *New(Args &&...args) { | 56 | 992k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 992k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 992k | return new (t) T(std::forward<Args>(args)...); | 61 | 992k | } |
bssl::X509Name* bssl::New<bssl::X509Name>() Line | Count | Source | 55 | 13.1k | T *New(Args &&...args) { | 56 | 13.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 13.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 13.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 13.1k | } |
bssl::X509NameCache* bssl::New<bssl::X509NameCache>() Line | Count | Source | 55 | 409k | T *New(Args &&...args) { | 56 | 409k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 409k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 409k | return new (t) T(std::forward<Args>(args)...); | 61 | 409k | } |
Unexecuted instantiation: bssl::X509Pubkey* bssl::New<bssl::X509Pubkey>() bssl::X509Impl* bssl::New<bssl::X509Impl>() Line | Count | Source | 55 | 235k | T *New(Args &&...args) { | 56 | 235k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 235k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 235k | return new (t) T(std::forward<Args>(args)...); | 61 | 235k | } |
asn1_object_st* bssl::New<asn1_object_st>() Line | Count | Source | 55 | 2.29M | T *New(Args &&...args) { | 56 | 2.29M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 2.29M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 2.29M | return new (t) T(std::forward<Args>(args)...); | 61 | 2.29M | } |
Unexecuted instantiation: bssl::ASN1_STRING_TABLE* bssl::New<bssl::ASN1_STRING_TABLE>() asn1_type_st* bssl::New<asn1_type_st>() Line | Count | Source | 55 | 590k | T *New(Args &&...args) { | 56 | 590k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 590k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 590k | return new (t) T(std::forward<Args>(args)...); | 61 | 590k | } |
asn1_string_st* bssl::New<asn1_string_st>() Line | Count | Source | 55 | 1.46M | T *New(Args &&...args) { | 56 | 1.46M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.46M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.46M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.46M | } |
Unexecuted instantiation: evp_encode_ctx_st* bssl::New<evp_encode_ctx_st>() bssl::DSAImpl* bssl::New<bssl::DSAImpl>() Line | Count | Source | 55 | 6.71k | T *New(Args &&...args) { | 56 | 6.71k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6.71k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6.71k | return new (t) T(std::forward<Args>(args)...); | 61 | 6.71k | } |
Unexecuted instantiation: DSA_SIG_st* bssl::New<DSA_SIG_st>() Unexecuted instantiation: p_xwing.cc:(anonymous namespace)::XWING_KEY* bssl::New<(anonymous namespace)::XWING_KEY>() Unexecuted instantiation: pkcs12_st* bssl::New<pkcs12_st>() Unexecuted instantiation: bssl::ByDir* bssl::New<bssl::ByDir>() Unexecuted instantiation: bssl::ByDirEntry* bssl::New<bssl::ByDirEntry>() bssl::conf_section_st* bssl::New<bssl::conf_section_st>() Line | Count | Source | 55 | 24.3k | T *New(Args &&...args) { | 56 | 24.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 24.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 24.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 24.3k | } |
conf_st* bssl::New<conf_st>() Line | Count | Source | 55 | 12.9k | T *New(Args &&...args) { | 56 | 12.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 12.9k | } |
conf_value_st* bssl::New<conf_value_st>() Line | Count | Source | 55 | 338k | T *New(Args &&...args) { | 56 | 338k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 338k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 338k | return new (t) T(std::forward<Args>(args)...); | 61 | 338k | } |
Unexecuted instantiation: X509_info_st* bssl::New<X509_info_st>() Unexecuted instantiation: private_key_st* bssl::New<private_key_st>() Unexecuted instantiation: PKCS7* bssl::New<PKCS7>() Unexecuted instantiation: PKCS7_SIGNED* bssl::New<PKCS7_SIGNED>() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>* bssl::New<bssl::Vector<v3_ext_method const*>>() Unexecuted instantiation: v3_ext_method* bssl::New<v3_ext_method>() bssl::DTLSReadEpoch* bssl::New<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 55 | 34.1k | T *New(Args &&...args) { | 56 | 34.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 34.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 34.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 34.1k | } |
bssl::DTLSWriteEpoch* bssl::New<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 55 | 7.95k | T *New(Args &&...args) { | 56 | 7.95k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 7.95k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 7.95k | return new (t) T(std::forward<Args>(args)...); | 61 | 7.95k | } |
|
62 | | |
63 | | // Delete behaves like `delete` but uses `OPENSSL_free` to release memory. |
64 | | // |
65 | | // Note: unlike `delete` this does not support non-public destructors. |
66 | | template <typename T> |
67 | 10.7M | void Delete(T *t) { |
68 | 10.7M | if (t != nullptr) { |
69 | 10.1M | t->~T(); |
70 | 10.1M | OPENSSL_free(t); |
71 | 10.1M | } |
72 | 10.7M | } Unexecuted instantiation: void bssl::Delete<bssl::ECHConfig>(bssl::ECHConfig*) void bssl::Delete<bssl::ECHServerConfig>(bssl::ECHServerConfig*) Line | Count | Source | 67 | 12.8k | void Delete(T *t) { | 68 | 12.8k | if (t != nullptr) { | 69 | 12.8k | t->~T(); | 70 | 12.8k | OPENSSL_free(t); | 71 | 12.8k | } | 72 | 12.8k | } |
void bssl::Delete<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*) Line | Count | Source | 67 | 308 | void Delete(T *t) { | 68 | 308 | if (t != nullptr) { | 69 | 308 | t->~T(); | 70 | 308 | OPENSSL_free(t); | 71 | 308 | } | 72 | 308 | } |
void bssl::Delete<bssl::SSLPAKEShare>(bssl::SSLPAKEShare*) Line | Count | Source | 67 | 44 | void Delete(T *t) { | 68 | 44 | if (t != nullptr) { | 69 | 44 | t->~T(); | 70 | 44 | OPENSSL_free(t); | 71 | 44 | } | 72 | 44 | } |
void bssl::Delete<bssl::SSLKeyShare>(bssl::SSLKeyShare*) Line | Count | Source | 67 | 150k | void Delete(T *t) { | 68 | 150k | if (t != nullptr) { | 69 | 150k | t->~T(); | 70 | 150k | OPENSSL_free(t); | 71 | 150k | } | 72 | 150k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Prover>(bssl::spake2plus::Prover*) void bssl::Delete<bssl::SSLCipherPreferenceList>(bssl::SSLCipherPreferenceList*) Line | Count | Source | 67 | 19.7k | void Delete(T *t) { | 68 | 19.7k | if (t != nullptr) { | 69 | 19.7k | t->~T(); | 70 | 19.7k | OPENSSL_free(t); | 71 | 19.7k | } | 72 | 19.7k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE_HINTS>(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 67 | 77.4k | void Delete(T *t) { | 68 | 77.4k | if (t != nullptr) { | 69 | 77.4k | t->~T(); | 70 | 77.4k | OPENSSL_free(t); | 71 | 77.4k | } | 72 | 77.4k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Verifier>(bssl::spake2plus::Verifier*) void bssl::Delete<bssl::SSL_HANDSHAKE>(bssl::SSL_HANDSHAKE*) Line | Count | Source | 67 | 97.2k | void Delete(T *t) { | 68 | 97.2k | if (t != nullptr) { | 69 | 97.2k | t->~T(); | 70 | 97.2k | OPENSSL_free(t); | 71 | 97.2k | } | 72 | 97.2k | } |
void bssl::Delete<bssl::SSLAEADContext>(bssl::SSLAEADContext*) Line | Count | Source | 67 | 251k | void Delete(T *t) { | 68 | 251k | if (t != nullptr) { | 69 | 251k | t->~T(); | 70 | 251k | OPENSSL_free(t); | 71 | 251k | } | 72 | 251k | } |
void bssl::Delete<bssl::CERT>(bssl::CERT*) Line | Count | Source | 67 | 63.7k | void Delete(T *t) { | 68 | 63.7k | if (t != nullptr) { | 69 | 63.7k | t->~T(); | 70 | 63.7k | OPENSSL_free(t); | 71 | 63.7k | } | 72 | 63.7k | } |
Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::ECKeyShare>(bssl::(anonymous namespace)::ECKeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::X25519KeyShare>(bssl::(anonymous namespace)::X25519KeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>(bssl::(anonymous namespace)::X25519MLKEM768KeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::MLKEM1024KeyShare>(bssl::(anonymous namespace)::MLKEM1024KeyShare*) void bssl::Delete<bssl::SSL_CONFIG>(bssl::SSL_CONFIG*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<bssl::SSLImpl>(bssl::SSLImpl*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<bssl::TicketKey>(bssl::TicketKey*) Line | Count | Source | 67 | 470 | void Delete(T *t) { | 68 | 470 | if (t != nullptr) { | 69 | 470 | t->~T(); | 70 | 470 | OPENSSL_free(t); | 71 | 470 | } | 72 | 470 | } |
void bssl::Delete<bssl::RecordNumberEncrypter>(bssl::RecordNumberEncrypter*) Line | Count | Source | 67 | 41.4k | void Delete(T *t) { | 68 | 41.4k | if (t != nullptr) { | 69 | 41.4k | t->~T(); | 70 | 41.4k | OPENSSL_free(t); | 71 | 41.4k | } | 72 | 41.4k | } |
Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::NullRecordNumberEncrypter>(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) void bssl::Delete<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul> >(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 67 | 10.8k | void Delete(T *t) { | 68 | 10.8k | if (t != nullptr) { | 69 | 10.8k | t->~T(); | 70 | 10.8k | OPENSSL_free(t); | 71 | 10.8k | } | 72 | 10.8k | } |
void bssl::Delete<bssl::DTLSIncomingMessage>(bssl::DTLSIncomingMessage*) Line | Count | Source | 67 | 49.9k | void Delete(T *t) { | 68 | 49.9k | if (t != nullptr) { | 69 | 49.9k | t->~T(); | 70 | 49.9k | OPENSSL_free(t); | 71 | 49.9k | } | 72 | 49.9k | } |
void bssl::Delete<bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch*) Line | Count | Source | 67 | 7.95k | void Delete(T *t) { | 68 | 7.95k | if (t != nullptr) { | 69 | 7.95k | t->~T(); | 70 | 7.95k | OPENSSL_free(t); | 71 | 7.95k | } | 72 | 7.95k | } |
void bssl::Delete<bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch*) Line | Count | Source | 67 | 34.1k | void Delete(T *t) { | 68 | 34.1k | if (t != nullptr) { | 69 | 34.1k | t->~T(); | 70 | 34.1k | OPENSSL_free(t); | 71 | 34.1k | } | 72 | 34.1k | } |
void bssl::Delete<bssl::DTLSPrevReadEpoch>(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 67 | 31.7k | void Delete(T *t) { | 68 | 31.7k | if (t != nullptr) { | 69 | 31.7k | t->~T(); | 70 | 31.7k | OPENSSL_free(t); | 71 | 31.7k | } | 72 | 31.7k | } |
void bssl::Delete<bssl::DTLS1_STATE>(bssl::DTLS1_STATE*) Line | Count | Source | 67 | 18.0k | void Delete(T *t) { | 68 | 18.0k | if (t != nullptr) { | 69 | 18.0k | t->~T(); | 70 | 18.0k | OPENSSL_free(t); | 71 | 18.0k | } | 72 | 18.0k | } |
void bssl::Delete<bssl::SSL3_STATE>(bssl::SSL3_STATE*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<ec_point_st>(ec_point_st*) Line | Count | Source | 67 | 148k | void Delete(T *t) { | 68 | 148k | if (t != nullptr) { | 69 | 148k | t->~T(); | 70 | 148k | OPENSSL_free(t); | 71 | 148k | } | 72 | 148k | } |
void bssl::Delete<bssl::EC_WRAPPED_SCALAR>(bssl::EC_WRAPPED_SCALAR*) Line | Count | Source | 67 | 67.7k | void Delete(T *t) { | 68 | 67.7k | if (t != nullptr) { | 69 | 3.50k | t->~T(); | 70 | 3.50k | OPENSSL_free(t); | 71 | 3.50k | } | 72 | 67.7k | } |
bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values*) Line | Count | Source | 67 | 339 | void Delete(T *t) { | 68 | 339 | if (t != nullptr) { | 69 | 339 | t->~T(); | 70 | 339 | OPENSSL_free(t); | 71 | 339 | } | 72 | 339 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>(mldsa::(anonymous namespace)::fips::keygen_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>(mldsa::(anonymous namespace)::fips::sign_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>(mldsa::(anonymous namespace)::fips::verify_self_test()::Values*) void bssl::Delete<bignum_st>(bignum_st*) Line | Count | Source | 67 | 671k | void Delete(T *t) { | 68 | 671k | if (t != nullptr) { | 69 | 671k | t->~T(); | 70 | 671k | OPENSSL_free(t); | 71 | 671k | } | 72 | 671k | } |
void bssl::Delete<bssl::BignumCtx>(bssl::BignumCtx*) Line | Count | Source | 67 | 67.0k | void Delete(T *t) { | 68 | 67.0k | if (t != nullptr) { | 69 | 67.0k | t->~T(); | 70 | 67.0k | OPENSSL_free(t); | 71 | 67.0k | } | 72 | 67.0k | } |
void bssl::Delete<bn_mont_ctx_st>(bn_mont_ctx_st*) Line | Count | Source | 67 | 24.3k | void Delete(T *t) { | 68 | 24.3k | if (t != nullptr) { | 69 | 24.3k | t->~T(); | 70 | 24.3k | OPENSSL_free(t); | 71 | 24.3k | } | 72 | 24.3k | } |
Unexecuted instantiation: void bssl::Delete<bn_gencb_st>(bn_gencb_st*) Unexecuted instantiation: void bssl::Delete<evp_aead_ctx_st>(evp_aead_ctx_st*) Unexecuted instantiation: void bssl::Delete<evp_cipher_ctx_st>(evp_cipher_ctx_st*) Unexecuted instantiation: void bssl::Delete<cmac_ctx_st>(cmac_ctx_st*) Unexecuted instantiation: void bssl::Delete<env_md_ctx_st>(env_md_ctx_st*) void bssl::Delete<hmac_ctx_st>(hmac_ctx_st*) Line | Count | Source | 67 | 26.4k | void Delete(T *t) { | 68 | 26.4k | if (t != nullptr) { | 69 | 26.4k | t->~T(); | 70 | 26.4k | OPENSSL_free(t); | 71 | 26.4k | } | 72 | 26.4k | } |
bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values*) Line | Count | Source | 67 | 302 | void Delete(T *t) { | 68 | 302 | if (t != nullptr) { | 69 | 302 | t->~T(); | 70 | 302 | OPENSSL_free(t); | 71 | 302 | } | 72 | 302 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values*) bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values*) Line | Count | Source | 67 | 161 | void Delete(T *t) { | 68 | 161 | if (t != nullptr) { | 69 | 161 | t->~T(); | 70 | 161 | OPENSSL_free(t); | 71 | 161 | } | 72 | 161 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: void bssl::Delete<ctr_drbg_state_st>(ctr_drbg_state_st*) Unexecuted instantiation: bcm.cc:void bssl::Delete<(anonymous namespace)::rand_thread_state>((anonymous namespace)::rand_thread_state*) Unexecuted instantiation: void bssl::Delete<bio_method_st>(bio_method_st*) void bssl::Delete<buf_mem_st>(buf_mem_st*) Line | Count | Source | 67 | 445k | void Delete(T *t) { | 68 | 445k | if (t != nullptr) { | 69 | 445k | t->~T(); | 70 | 445k | OPENSSL_free(t); | 71 | 445k | } | 72 | 445k | } |
void bssl::Delete<ecdsa_sig_st>(ecdsa_sig_st*) Line | Count | Source | 67 | 21.1k | void Delete(T *t) { | 68 | 21.1k | if (t != nullptr) { | 69 | 21.1k | t->~T(); | 70 | 21.1k | OPENSSL_free(t); | 71 | 21.1k | } | 72 | 21.1k | } |
Unexecuted instantiation: void bssl::Delete<engine_st>(engine_st*) void bssl::Delete<bssl::EvpPkeyCtx>(bssl::EvpPkeyCtx*) Line | Count | Source | 67 | 119k | void Delete(T *t) { | 68 | 119k | if (t != nullptr) { | 69 | 119k | t->~T(); | 70 | 119k | OPENSSL_free(t); | 71 | 119k | } | 72 | 119k | } |
Unexecuted instantiation: p_dh.cc:void bssl::Delete<(anonymous namespace)::DH_PKEY_CTX>((anonymous namespace)::DH_PKEY_CTX*) p_ec.cc:void bssl::Delete<(anonymous namespace)::EC_PKEY_CTX>((anonymous namespace)::EC_PKEY_CTX*) Line | Count | Source | 67 | 38.3k | void Delete(T *t) { | 68 | 38.3k | if (t != nullptr) { | 69 | 38.3k | t->~T(); | 70 | 38.3k | OPENSSL_free(t); | 71 | 38.3k | } | 72 | 38.3k | } |
p_ed25519.cc:void bssl::Delete<(anonymous namespace)::ED25519_KEY>((anonymous namespace)::ED25519_KEY*) Line | Count | Source | 67 | 278 | void Delete(T *t) { | 68 | 278 | if (t != nullptr) { | 69 | 278 | t->~T(); | 70 | 278 | OPENSSL_free(t); | 71 | 278 | } | 72 | 278 | } |
Unexecuted instantiation: p_hkdf.cc:void bssl::Delete<(anonymous namespace)::HKDF_PKEY_CTX>((anonymous namespace)::HKDF_PKEY_CTX*) p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 67 | 186 | void Delete(T *t) { | 68 | 186 | if (t != nullptr) { | 69 | 186 | t->~T(); | 70 | 186 | OPENSSL_free(t); | 71 | 186 | } | 72 | 186 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 67 | 17 | void Delete(T *t) { | 68 | 17 | if (t != nullptr) { | 69 | 17 | t->~T(); | 70 | 17 | OPENSSL_free(t); | 71 | 17 | } | 72 | 17 | } |
Unexecuted instantiation: p_mldsa.cc:void bssl::Delete<(anonymous namespace)::MldsaPkeyCtx>((anonymous namespace)::MldsaPkeyCtx*) p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 377 | void Delete(T *t) { | 68 | 377 | if (t != nullptr) { | 69 | 377 | t->~T(); | 70 | 377 | OPENSSL_free(t); | 71 | 377 | } | 72 | 377 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 13 | void Delete(T *t) { | 68 | 13 | if (t != nullptr) { | 69 | 13 | t->~T(); | 70 | 13 | OPENSSL_free(t); | 71 | 13 | } | 72 | 13 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 341 | void Delete(T *t) { | 68 | 341 | if (t != nullptr) { | 69 | 341 | t->~T(); | 70 | 341 | OPENSSL_free(t); | 71 | 341 | } | 72 | 341 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 17 | void Delete(T *t) { | 68 | 17 | if (t != nullptr) { | 69 | 17 | t->~T(); | 70 | 17 | OPENSSL_free(t); | 71 | 17 | } | 72 | 17 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 85 | void Delete(T *t) { | 68 | 85 | if (t != nullptr) { | 69 | 85 | t->~T(); | 70 | 85 | OPENSSL_free(t); | 71 | 85 | } | 72 | 85 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 260 | void Delete(T *t) { | 68 | 260 | if (t != nullptr) { | 69 | 260 | t->~T(); | 70 | 260 | OPENSSL_free(t); | 71 | 260 | } | 72 | 260 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 87 | void Delete(T *t) { | 68 | 87 | if (t != nullptr) { | 69 | 87 | t->~T(); | 70 | 87 | OPENSSL_free(t); | 71 | 87 | } | 72 | 87 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 131 | void Delete(T *t) { | 68 | 131 | if (t != nullptr) { | 69 | 131 | t->~T(); | 70 | 131 | OPENSSL_free(t); | 71 | 131 | } | 72 | 131 | } |
p_rsa.cc:void bssl::Delete<(anonymous namespace)::RSA_PKEY_CTX>((anonymous namespace)::RSA_PKEY_CTX*) Line | Count | Source | 67 | 80.9k | void Delete(T *t) { | 68 | 80.9k | if (t != nullptr) { | 69 | 80.9k | t->~T(); | 70 | 80.9k | OPENSSL_free(t); | 71 | 80.9k | } | 72 | 80.9k | } |
Unexecuted instantiation: void bssl::Delete<evp_hpke_key_st>(evp_hpke_key_st*) Unexecuted instantiation: void bssl::Delete<evp_hpke_ctx_st>(evp_hpke_ctx_st*) void bssl::Delete<bssl::_LHASH>(bssl::_LHASH*) Line | Count | Source | 67 | 30.8k | void Delete(T *t) { | 68 | 30.8k | if (t != nullptr) { | 69 | 30.8k | t->~T(); | 70 | 30.8k | OPENSSL_free(t); | 71 | 30.8k | } | 72 | 30.8k | } |
void bssl::Delete<bssl::LHASH_ITEM>(bssl::LHASH_ITEM*) Line | Count | Source | 67 | 90.2k | void Delete(T *t) { | 68 | 90.2k | if (t != nullptr) { | 69 | 90.2k | t->~T(); | 70 | 90.2k | OPENSSL_free(t); | 71 | 90.2k | } | 72 | 90.2k | } |
void bssl::Delete<stack_st>(stack_st*) Line | Count | Source | 67 | 1.37M | void Delete(T *t) { | 68 | 1.37M | if (t != nullptr) { | 69 | 1.37M | t->~T(); | 70 | 1.37M | OPENSSL_free(t); | 71 | 1.37M | } | 72 | 1.37M | } |
Unexecuted instantiation: void bssl::Delete<x509_lookup_st>(x509_lookup_st*) Unexecuted instantiation: void bssl::Delete<x509_object_st>(x509_object_st*) void bssl::Delete<x509_store_ctx_st>(x509_store_ctx_st*) Line | Count | Source | 67 | 7.85k | void Delete(T *t) { | 68 | 7.85k | if (t != nullptr) { | 69 | 7.85k | t->~T(); | 70 | 7.85k | OPENSSL_free(t); | 71 | 7.85k | } | 72 | 7.85k | } |
void bssl::Delete<X509_VERIFY_PARAM_st>(X509_VERIFY_PARAM_st*) Line | Count | Source | 67 | 76.6k | void Delete(T *t) { | 68 | 76.6k | if (t != nullptr) { | 69 | 76.6k | t->~T(); | 70 | 76.6k | OPENSSL_free(t); | 71 | 76.6k | } | 72 | 76.6k | } |
void bssl::Delete<bssl::X509NameEntry>(bssl::X509NameEntry*) Line | Count | Source | 67 | 992k | void Delete(T *t) { | 68 | 992k | if (t != nullptr) { | 69 | 992k | t->~T(); | 70 | 992k | OPENSSL_free(t); | 71 | 992k | } | 72 | 992k | } |
void bssl::Delete<bssl::X509NameCache>(bssl::X509NameCache*) Line | Count | Source | 67 | 909k | void Delete(T *t) { | 68 | 909k | if (t != nullptr) { | 69 | 409k | t->~T(); | 70 | 409k | OPENSSL_free(t); | 71 | 409k | } | 72 | 909k | } |
void bssl::Delete<bssl::X509Name>(bssl::X509Name*) Line | Count | Source | 67 | 16.8k | void Delete(T *t) { | 68 | 16.8k | if (t != nullptr) { | 69 | 13.1k | t->~T(); | 70 | 13.1k | OPENSSL_free(t); | 71 | 13.1k | } | 72 | 16.8k | } |
Unexecuted instantiation: void bssl::Delete<bssl::X509Pubkey>(bssl::X509Pubkey*) void bssl::Delete<asn1_object_st>(asn1_object_st*) Line | Count | Source | 67 | 2.29M | void Delete(T *t) { | 68 | 2.29M | if (t != nullptr) { | 69 | 2.29M | t->~T(); | 70 | 2.29M | OPENSSL_free(t); | 71 | 2.29M | } | 72 | 2.29M | } |
Unexecuted instantiation: void bssl::Delete<bssl::ASN1_STRING_TABLE>(bssl::ASN1_STRING_TABLE*) void bssl::Delete<asn1_type_st>(asn1_type_st*) Line | Count | Source | 67 | 590k | void Delete(T *t) { | 68 | 590k | if (t != nullptr) { | 69 | 590k | t->~T(); | 70 | 590k | OPENSSL_free(t); | 71 | 590k | } | 72 | 590k | } |
void bssl::Delete<asn1_string_st>(asn1_string_st*) Line | Count | Source | 67 | 1.46M | void Delete(T *t) { | 68 | 1.46M | if (t != nullptr) { | 69 | 1.46M | t->~T(); | 70 | 1.46M | OPENSSL_free(t); | 71 | 1.46M | } | 72 | 1.46M | } |
Unexecuted instantiation: void bssl::Delete<evp_encode_ctx_st>(evp_encode_ctx_st*) Unexecuted instantiation: void bssl::Delete<DSA_SIG_st>(DSA_SIG_st*) Unexecuted instantiation: p_xwing.cc:void bssl::Delete<(anonymous namespace)::XWING_KEY>((anonymous namespace)::XWING_KEY*) Unexecuted instantiation: void bssl::Delete<pkcs12_st>(pkcs12_st*) Unexecuted instantiation: void bssl::Delete<bssl::ByDir>(bssl::ByDir*) Unexecuted instantiation: void bssl::Delete<bssl::ByDirEntry>(bssl::ByDirEntry*) void bssl::Delete<bssl::conf_section_st>(bssl::conf_section_st*) Line | Count | Source | 67 | 24.3k | void Delete(T *t) { | 68 | 24.3k | if (t != nullptr) { | 69 | 24.3k | t->~T(); | 70 | 24.3k | OPENSSL_free(t); | 71 | 24.3k | } | 72 | 24.3k | } |
void bssl::Delete<conf_value_st>(conf_value_st*) Line | Count | Source | 67 | 63.2k | void Delete(T *t) { | 68 | 63.2k | if (t != nullptr) { | 69 | 63.2k | t->~T(); | 70 | 63.2k | OPENSSL_free(t); | 71 | 63.2k | } | 72 | 63.2k | } |
void bssl::Delete<conf_st>(conf_st*) Line | Count | Source | 67 | 12.9k | void Delete(T *t) { | 68 | 12.9k | if (t != nullptr) { | 69 | 12.9k | t->~T(); | 70 | 12.9k | OPENSSL_free(t); | 71 | 12.9k | } | 72 | 12.9k | } |
void bssl::Delete<char>(char*) Line | Count | Source | 67 | 12.9k | void Delete(T *t) { | 68 | 12.9k | if (t != nullptr) { | 69 | 12.9k | t->~T(); | 70 | 12.9k | OPENSSL_free(t); | 71 | 12.9k | } | 72 | 12.9k | } |
Unexecuted instantiation: void bssl::Delete<private_key_st>(private_key_st*) Unexecuted instantiation: void bssl::Delete<X509_info_st>(X509_info_st*) Unexecuted instantiation: void bssl::Delete<PKCS7_SIGNED>(PKCS7_SIGNED*) Unexecuted instantiation: void bssl::Delete<PKCS7>(PKCS7*) Unexecuted instantiation: void bssl::Delete<v3_ext_method>(v3_ext_method*) |
73 | | |
74 | | namespace internal { |
75 | | |
76 | | // All types with kAllowUniquePtr set may be used with UniquePtr. Other types |
77 | | // may be C structs which require a `BORINGSSL_MAKE_DELETER` registration. Where |
78 | | // an internal type cannot be annotated (e.g. an alias of std::variant), use |
79 | | // `BORINGSSL_MAKE_DELETER(T, Delete)`. |
80 | | template <typename T> |
81 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowUniquePtr>> { |
82 | 911k | static void Free(T *t) { Delete(t); }Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ECHConfig, void>::Free(bssl::ECHConfig*) bssl::internal::DeleterImpl<bssl::ECHServerConfig, void>::Free(bssl::ECHServerConfig*) Line | Count | Source | 82 | 12.8k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLPAKEShare, void>::Free(bssl::SSLPAKEShare*) Line | Count | Source | 82 | 44 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLKeyShare, void>::Free(bssl::SSLKeyShare*) Line | Count | Source | 82 | 150k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::spake2plus::Prover, void>::Free(bssl::spake2plus::Prover*) bssl::internal::DeleterImpl<bssl::SSLCipherPreferenceList, void>::Free(bssl::SSLCipherPreferenceList*) Line | Count | Source | 82 | 19.7k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE_HINTS, void>::Free(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 82 | 77.4k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::spake2plus::Verifier, void>::Free(bssl::spake2plus::Verifier*) bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE, void>::Free(bssl::SSL_HANDSHAKE*) Line | Count | Source | 82 | 97.2k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLAEADContext, void>::Free(bssl::SSLAEADContext*) Line | Count | Source | 82 | 251k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::CERT, void>::Free(bssl::CERT*) Line | Count | Source | 82 | 63.7k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ECKeyShare, void>::Free(bssl::(anonymous namespace)::ECKeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::X25519KeyShare, void>::Free(bssl::(anonymous namespace)::X25519KeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::X25519MLKEM768KeyShare, void>::Free(bssl::(anonymous namespace)::X25519MLKEM768KeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::MLKEM1024KeyShare, void>::Free(bssl::(anonymous namespace)::MLKEM1024KeyShare*) bssl::internal::DeleterImpl<bssl::SSL_CONFIG, void>::Free(bssl::SSL_CONFIG*) Line | Count | Source | 82 | 58.8k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::SSLImpl, void>::Free(bssl::SSLImpl*) bssl::internal::DeleterImpl<bssl::TicketKey, void>::Free(bssl::TicketKey*) Line | Count | Source | 82 | 470 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::RecordNumberEncrypter, void>::Free(bssl::RecordNumberEncrypter*) Line | Count | Source | 82 | 41.4k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::NullRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) bssl::internal::DeleterImpl<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, void>::Free(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 82 | 10.8k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSIncomingMessage, void>::Free(bssl::DTLSIncomingMessage*) Line | Count | Source | 82 | 49.9k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSWriteEpoch, void>::Free(bssl::DTLSWriteEpoch*) Line | Count | Source | 82 | 7.95k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSReadEpoch, void>::Free(bssl::DTLSReadEpoch*) Line | Count | Source | 82 | 34.1k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSPrevReadEpoch, void>::Free(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 82 | 31.7k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::DTLS1_STATE, void>::Free(bssl::DTLS1_STATE*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::SSL3_STATE, void>::Free(bssl::SSL3_STATE*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values*) Line | Count | Source | 82 | 339 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::keygen_self_test()::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::sign_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::sign_self_test()::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::verify_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::verify_self_test()::Values*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values*) Line | Count | Source | 82 | 302 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values*) Line | Count | Source | 82 | 161 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::EvpPkeyCtx, void>::Free(bssl::EvpPkeyCtx*) p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 82 | 25 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 82 | 13 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 82 | 38 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 82 | 11 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 82 | 39 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 82 | 13 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 82 | 24 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 82 | 149 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 82 | 17 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 82 | 90 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::X509NameEntry, void>::Free(bssl::X509NameEntry*) Line | Count | Source | 82 | 1.28k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509NameCache, void>::Free(bssl::X509NameCache*) Unexecuted instantiation: p_xwing.cc:bssl::internal::DeleterImpl<(anonymous namespace)::XWING_KEY, void>::Free((anonymous namespace)::XWING_KEY*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ByDirEntry, void>::Free(bssl::ByDirEntry*) |
83 | | }; |
84 | | |
85 | | // All types with kAllowRefCountedUniquePtr may be used with UniquePtr, which |
86 | | // then will behave like std::shared_ptr. |
87 | | template <typename T> |
88 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowRefCountedUniquePtr>> { |
89 | 748k | static void Free(T *t) { t->DecRefInternal(); }bssl::internal::DeleterImpl<bssl::SSLECHKeys, void>::Free(bssl::SSLECHKeys*) Line | Count | Source | 89 | 422 | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLCredential, void>::Free(bssl::SSLCredential*) Line | Count | Source | 89 | 143k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLSession, void>::Free(bssl::SSLSession*) Line | Count | Source | 89 | 239k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLContext, void>::Free(bssl::SSLContext*) Line | Count | Source | 89 | 117k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::RSAImpl, void>::Free(bssl::RSAImpl*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ECCustomGroup, void>::Free(bssl::ECCustomGroup*) bssl::internal::DeleterImpl<bssl::ECKey, void>::Free(bssl::ECKey*) Line | Count | Source | 89 | 2.66k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::Bio, void>::Free(bssl::Bio*) bssl::internal::DeleterImpl<bssl::EvpPkey, void>::Free(bssl::EvpPkey*) Line | Count | Source | 89 | 222k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::DSAImpl, void>::Free(bssl::DSAImpl*) Line | Count | Source | 89 | 5.82k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPoolHandle, void>::Free(bssl::CryptoBufferPoolHandle*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPool, void>::Free(bssl::CryptoBufferPool*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBuffer, void>::Free(bssl::CryptoBuffer*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509Store, void>::Free(bssl::X509Store*) bssl::internal::DeleterImpl<bssl::X509Impl, void>::Free(bssl::X509Impl*) Line | Count | Source | 89 | 16.3k | static void Free(T *t) { t->DecRefInternal(); } |
|
90 | | }; |
91 | | |
92 | | } // namespace internal |
93 | | |
94 | | // All types with kAllowRefCountedUniquePtr types also automatically get an |
95 | | // UpRef function. Other types may be C structs which require a |
96 | | // `BORINGSSL_MAKE_UP_REF` registration. |
97 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
98 | 446k | inline UniquePtr<T> UpRef(const T *v) { |
99 | 446k | if (v != nullptr) { |
100 | 385k | v->UpRefInternal(); |
101 | 385k | } |
102 | 446k | return UniquePtr<T>(const_cast<T *>(v)); |
103 | 446k | } std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> bssl::UpRef<bssl::SSLECHKeys, void>(bssl::SSLECHKeys const*) Line | Count | Source | 98 | 428 | inline UniquePtr<T> UpRef(const T *v) { | 99 | 428 | if (v != nullptr) { | 100 | 428 | v->UpRefInternal(); | 101 | 428 | } | 102 | 428 | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 428 | } |
std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::UpRef<bssl::SSLSession, void>(bssl::SSLSession const*) Line | Count | Source | 98 | 129k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 129k | if (v != nullptr) { | 100 | 127k | v->UpRefInternal(); | 101 | 127k | } | 102 | 129k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 129k | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::UpRef<bssl::SSLCredential, void>(bssl::SSLCredential const*) Line | Count | Source | 98 | 20.5k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 20.5k | if (v != nullptr) { | 100 | 20.5k | v->UpRefInternal(); | 101 | 20.5k | } | 102 | 20.5k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 20.5k | } |
std::__1::unique_ptr<bssl::SSLContext, bssl::internal::Deleter> bssl::UpRef<bssl::SSLContext, void>(bssl::SSLContext const*) Line | Count | Source | 98 | 117k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 117k | if (v != nullptr) { | 100 | 117k | v->UpRefInternal(); | 101 | 117k | } | 102 | 117k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 117k | } |
std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> bssl::UpRef<bssl::EvpPkey, void>(bssl::EvpPkey const*) Line | Count | Source | 98 | 178k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 178k | if (v != nullptr) { | 100 | 119k | v->UpRefInternal(); | 101 | 119k | } | 102 | 178k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 178k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBuffer, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBuffer, void>(bssl::CryptoBuffer const*) Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBufferPoolHandle, void>(bssl::CryptoBufferPoolHandle const*) |
104 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
105 | 120k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { |
106 | 120k | return UpRef(ptr.get()); |
107 | 120k | } std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::UpRef<bssl::SSLSession, void>(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 630 | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 630 | return UpRef(ptr.get()); | 107 | 630 | } |
std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> bssl::UpRef<bssl::SSLECHKeys, void>(std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 422 | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 422 | return UpRef(ptr.get()); | 107 | 422 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::UpRef<bssl::SSLCredential, void>(std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> const&) std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> bssl::UpRef<bssl::EvpPkey, void>(std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 119k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 119k | return UpRef(ptr.get()); | 107 | 119k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBufferPoolHandle, void>(std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> const&) |
108 | | |
109 | | // MakeUnique behaves like `std::make_unique` but returns nullptr on allocation |
110 | | // error. |
111 | | template <typename T, typename... Args> |
112 | 3.26M | UniquePtr<T> MakeUnique(Args &&...args) { |
113 | 3.26M | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); |
114 | 3.26M | } Unexecuted instantiation: std::__1::unique_ptr<bssl::ECHConfig, bssl::internal::Deleter> bssl::MakeUnique<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> bssl::MakeUnique<bssl::ECHServerConfig>() Line | Count | Source | 112 | 12.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 12.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 12.8k | } |
std::__1::unique_ptr<bssl::SSLPAKEShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLPAKEShare>() Line | Count | Source | 112 | 44 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 44 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 44 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::spake2plus::Prover, bssl::internal::Deleter> bssl::MakeUnique<bssl::spake2plus::Prover>() std::__1::unique_ptr<bssl::SSLCipherPreferenceList, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCipherPreferenceList>() Line | Count | Source | 112 | 19.7k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 19.7k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 19.7k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE_HINTS, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 112 | 77.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 77.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 77.4k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE, bssl::SSLImpl*&>(bssl::SSLImpl*&) Line | Count | Source | 112 | 97.2k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 97.2k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 97.2k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 112 | 133k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 133k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 133k | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 112 | 63.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 63.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 63.8k | } |
std::__1::unique_ptr<bssl::CERT, bssl::internal::Deleter> bssl::MakeUnique<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ECKeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 112 | 14.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 14.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 14.1k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 112 | 84.5k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 84.5k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 84.5k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519MLKEM768KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 112 | 52.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 52.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 52.1k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::MLKEM1024KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 112 | 25 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 25 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 25 | } |
std::__1::unique_ptr<bssl::SSLContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLContext, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 112 | 4.98k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 4.98k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 4.98k | } |
std::__1::unique_ptr<bssl::CERT, bssl::internal::Deleter> bssl::MakeUnique<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 112 | 4.98k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 4.98k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 4.98k | } |
std::__1::unique_ptr<bssl::SSLImpl, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLImpl, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
std::__1::unique_ptr<bssl::SSL_CONFIG, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_CONFIG, bssl::SSLImpl*>(bssl::SSLImpl*&&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
std::__1::unique_ptr<bssl::TicketKey, bssl::internal::Deleter> bssl::MakeUnique<bssl::TicketKey>() Line | Count | Source | 112 | 473 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 473 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 473 | } |
std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLSession, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 112 | 252k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 252k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 252k | } |
tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::NullRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 112 | 41.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 41.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 41.4k | } |
Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: std::__1::unique_ptr<bssl::spake2plus::Verifier, bssl::internal::Deleter> bssl::MakeUnique<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter>&&) Line | Count | Source | 112 | 308 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 308 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 308 | } |
std::__1::unique_ptr<bssl::DTLSIncomingMessage, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSIncomingMessage, bssl::DTLSHandshakeHeader const&>(bssl::DTLSHandshakeHeader const&) Line | Count | Source | 112 | 49.9k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 49.9k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 49.9k | } |
std::__1::unique_ptr<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, bssl::internal::Deleter> bssl::MakeUnique<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 112 | 10.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 10.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 10.8k | } |
std::__1::unique_ptr<bssl::DTLS1_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLS1_STATE>() Line | Count | Source | 112 | 18.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 18.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 18.0k | } |
std::__1::unique_ptr<bssl::DTLSPrevReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 112 | 31.7k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 31.7k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 31.7k | } |
std::__1::unique_ptr<bssl::SSL3_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL3_STATE>() Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>() Line | Count | Source | 112 | 339 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 339 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 339 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::sign_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::verify_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>() Line | Count | Source | 112 | 302 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 302 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 302 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>() Line | Count | Source | 112 | 161 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 161 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 161 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>() std::__1::unique_ptr<bssl::EvpPkeyCtx, bssl::internal::Deleter> bssl::MakeUnique<bssl::EvpPkeyCtx>() Line | Count | Source | 112 | 119k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 119k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 119k | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 112 | 186 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 186 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 186 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 112 | 17 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 17 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 17 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 112 | 377 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 377 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 377 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 112 | 13 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 13 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 13 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 112 | 341 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 341 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 341 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 112 | 17 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 17 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 17 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 112 | 85 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 85 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 85 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 112 | 260 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 260 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 260 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 112 | 87 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 87 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 87 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 112 | 131 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 131 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 131 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPool, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBufferPool>() Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBufferPoolHandle, bssl::CryptoBufferPool*>(bssl::CryptoBufferPool*&&) std::__1::unique_ptr<bssl::CryptoBuffer, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBuffer>() Line | Count | Source | 112 | 351k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 351k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 351k | } |
Unexecuted instantiation: std::__1::unique_ptr<X509_algor_st, bssl::internal::Deleter> bssl::MakeUnique<X509_algor_st>() std::__1::unique_ptr<bssl::X509NameEntry, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509NameEntry>() Line | Count | Source | 112 | 959k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 959k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 959k | } |
std::__1::unique_ptr<bssl::X509NameCache, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509NameCache>() Line | Count | Source | 112 | 409k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 409k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 409k | } |
Unexecuted instantiation: p_xwing.cc:std::__1::unique_ptr<(anonymous namespace)::XWING_KEY, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::XWING_KEY>() Unexecuted instantiation: std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> bssl::MakeUnique<bssl::ByDirEntry>() std::__1::unique_ptr<bssl::DTLSReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 112 | 34.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 34.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 34.1k | } |
std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 112 | 7.95k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 7.95k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 7.95k | } |
|
115 | | |
116 | | |
117 | | // RefCounted is a common base for ref-counted types. This is an instance of the |
118 | | // C++ curiously-recurring template pattern, so a type Foo must subclass |
119 | | // RefCounted<Foo>. It additionally must friend RefCounted<Foo> to allow calling |
120 | | // the destructor. |
121 | | template <typename Derived> |
122 | | class RefCounted { |
123 | | public: |
124 | | static constexpr bool kAllowRefCountedUniquePtr = true; |
125 | | |
126 | | RefCounted(const RefCounted &) = delete; |
127 | | RefCounted &operator=(const RefCounted &) = delete; |
128 | | |
129 | | // These methods are intentionally named differently from `bssl::UpRef` to |
130 | | // avoid a collision. Only the implementations of `FOO_up_ref` and `FOO_free` |
131 | | // should call these. `DecRefInternal` returns true if the object was freed |
132 | | // and false if there are still references. |
133 | 784k | void UpRefInternal() const { |
134 | | // Safety: the following call does not mutate anything other than the atomic |
135 | | // ref-count variable. |
136 | 784k | CRYPTO_refcount_inc(&references_); |
137 | 784k | } bssl::RefCounted<bssl::SSLECHKeys>::UpRefInternal() const Line | Count | Source | 133 | 428 | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 428 | CRYPTO_refcount_inc(&references_); | 137 | 428 | } |
bssl::RefCounted<bssl::SSLSession>::UpRefInternal() const Line | Count | Source | 133 | 127k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 127k | CRYPTO_refcount_inc(&references_); | 137 | 127k | } |
bssl::RefCounted<bssl::SSLCredential>::UpRefInternal() const Line | Count | Source | 133 | 20.5k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 20.5k | CRYPTO_refcount_inc(&references_); | 137 | 20.5k | } |
bssl::RefCounted<bssl::SSLContext>::UpRefInternal() const Line | Count | Source | 133 | 117k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 117k | CRYPTO_refcount_inc(&references_); | 137 | 117k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::RSAImpl>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::Bio>::UpRefInternal() const bssl::RefCounted<bssl::EvpPkey>::UpRefInternal() const Line | Count | Source | 133 | 289k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 289k | CRYPTO_refcount_inc(&references_); | 137 | 289k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::X509Store>::UpRefInternal() const bssl::RefCounted<bssl::X509Impl>::UpRefInternal() const Line | Count | Source | 133 | 228k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 228k | CRYPTO_refcount_inc(&references_); | 137 | 228k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::UpRefInternal() const |
138 | | |
139 | | // Only the implementations of `FOO_dup_ref` should call these. |
140 | 397k | Derived *DupRefInternal() const { |
141 | 397k | UpRefInternal(); |
142 | 397k | return const_cast<Derived *>(static_cast<const Derived *>(this)); |
143 | 397k | } Unexecuted instantiation: bssl::RefCounted<bssl::SSLECHKeys>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLCredential>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLContext>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLSession>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::RSAImpl>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::Bio>::DupRefInternal() const bssl::RefCounted<bssl::EvpPkey>::DupRefInternal() const Line | Count | Source | 140 | 169k | Derived *DupRefInternal() const { | 141 | 169k | UpRefInternal(); | 142 | 169k | return const_cast<Derived *>(static_cast<const Derived *>(this)); | 143 | 169k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::X509Store>::DupRefInternal() const bssl::RefCounted<bssl::X509Impl>::DupRefInternal() const Line | Count | Source | 140 | 228k | Derived *DupRefInternal() const { | 141 | 228k | UpRefInternal(); | 142 | 228k | return const_cast<Derived *>(static_cast<const Derived *>(this)); | 143 | 228k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::DupRefInternal() const |
144 | | |
145 | 1.98M | bool DecRefInternal() { |
146 | 1.98M | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { |
147 | 1.20M | Derived *d = static_cast<Derived *>(this); |
148 | 1.20M | d->~Derived(); |
149 | 1.20M | OPENSSL_free(d); |
150 | 1.20M | return true; |
151 | 1.20M | } |
152 | 784k | return false; |
153 | 1.98M | } bssl::RefCounted<bssl::SSLECHKeys>::DecRefInternal() Line | Count | Source | 145 | 15.3k | bool DecRefInternal() { | 146 | 15.3k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 14.9k | Derived *d = static_cast<Derived *>(this); | 148 | 14.9k | d->~Derived(); | 149 | 14.9k | OPENSSL_free(d); | 150 | 14.9k | return true; | 151 | 14.9k | } | 152 | 428 | return false; | 153 | 15.3k | } |
bssl::RefCounted<bssl::SSLCredential>::DecRefInternal() Line | Count | Source | 145 | 143k | bool DecRefInternal() { | 146 | 143k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 122k | Derived *d = static_cast<Derived *>(this); | 148 | 122k | d->~Derived(); | 149 | 122k | OPENSSL_free(d); | 150 | 122k | return true; | 151 | 122k | } | 152 | 20.5k | return false; | 153 | 143k | } |
bssl::RefCounted<bssl::SSLSession>::DecRefInternal() Line | Count | Source | 145 | 380k | bool DecRefInternal() { | 146 | 380k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 252k | Derived *d = static_cast<Derived *>(this); | 148 | 252k | d->~Derived(); | 149 | 252k | OPENSSL_free(d); | 150 | 252k | return true; | 151 | 252k | } | 152 | 127k | return false; | 153 | 380k | } |
bssl::RefCounted<bssl::SSLContext>::DecRefInternal() Line | Count | Source | 145 | 122k | bool DecRefInternal() { | 146 | 122k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 4.97k | Derived *d = static_cast<Derived *>(this); | 148 | 4.97k | d->~Derived(); | 149 | 4.97k | OPENSSL_free(d); | 150 | 4.97k | return true; | 151 | 4.97k | } | 152 | 117k | return false; | 153 | 122k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::DecRefInternal() bssl::RefCounted<bssl::ECKey>::DecRefInternal() Line | Count | Source | 145 | 64.1k | bool DecRefInternal() { | 146 | 64.1k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 64.1k | Derived *d = static_cast<Derived *>(this); | 148 | 64.1k | d->~Derived(); | 149 | 64.1k | OPENSSL_free(d); | 150 | 64.1k | return true; | 151 | 64.1k | } | 152 | 0 | return false; | 153 | 64.1k | } |
bssl::RefCounted<bssl::RSAImpl>::DecRefInternal() Line | Count | Source | 145 | 146k | bool DecRefInternal() { | 146 | 146k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 146k | Derived *d = static_cast<Derived *>(this); | 148 | 146k | d->~Derived(); | 149 | 146k | OPENSSL_free(d); | 150 | 146k | return true; | 151 | 146k | } | 152 | 0 | return false; | 153 | 146k | } |
bssl::RefCounted<bssl::Bio>::DecRefInternal() Line | Count | Source | 145 | 77.6k | bool DecRefInternal() { | 146 | 77.6k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 77.6k | Derived *d = static_cast<Derived *>(this); | 148 | 77.6k | d->~Derived(); | 149 | 77.6k | OPENSSL_free(d); | 150 | 77.6k | return true; | 151 | 77.6k | } | 152 | 0 | return false; | 153 | 77.6k | } |
bssl::RefCounted<bssl::EvpPkey>::DecRefInternal() Line | Count | Source | 145 | 562k | bool DecRefInternal() { | 146 | 562k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 272k | Derived *d = static_cast<Derived *>(this); | 148 | 272k | d->~Derived(); | 149 | 272k | OPENSSL_free(d); | 150 | 272k | return true; | 151 | 272k | } | 152 | 289k | return false; | 153 | 562k | } |
bssl::RefCounted<bssl::DSAImpl>::DecRefInternal() Line | Count | Source | 145 | 6.71k | bool DecRefInternal() { | 146 | 6.71k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 6.71k | Derived *d = static_cast<Derived *>(this); | 148 | 6.71k | d->~Derived(); | 149 | 6.71k | OPENSSL_free(d); | 150 | 6.71k | return true; | 151 | 6.71k | } | 152 | 0 | return false; | 153 | 6.71k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::DecRefInternal() bssl::RefCounted<bssl::X509Store>::DecRefInternal() Line | Count | Source | 145 | 4.97k | bool DecRefInternal() { | 146 | 4.97k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 4.97k | Derived *d = static_cast<Derived *>(this); | 148 | 4.97k | d->~Derived(); | 149 | 4.97k | OPENSSL_free(d); | 150 | 4.97k | return true; | 151 | 4.97k | } | 152 | 0 | return false; | 153 | 4.97k | } |
bssl::RefCounted<bssl::X509Impl>::DecRefInternal() Line | Count | Source | 145 | 464k | bool DecRefInternal() { | 146 | 464k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 235k | Derived *d = static_cast<Derived *>(this); | 148 | 235k | d->~Derived(); | 149 | 235k | OPENSSL_free(d); | 150 | 235k | return true; | 151 | 235k | } | 152 | 228k | return false; | 153 | 464k | } |
|
154 | | |
155 | | protected: |
156 | | // Ensure that only `Derived`, which must inherit from `RefCounted<Derived>`, |
157 | | // can call the constructor. This catches bugs where someone inherited from |
158 | | // the wrong base. |
159 | | class CheckSubClass { |
160 | | private: |
161 | | friend Derived; |
162 | | CheckSubClass() = default; |
163 | | }; |
164 | 1.20M | RefCounted(CheckSubClass) { |
165 | 1.20M | static_assert(std::is_base_of_v<RefCounted, Derived>, |
166 | 1.20M | "Derived must subclass RefCounted<Derived>"); |
167 | 1.20M | } bssl::RefCounted<bssl::SSLECHKeys>::RefCounted(bssl::RefCounted<bssl::SSLECHKeys>::CheckSubClass) Line | Count | Source | 164 | 14.9k | RefCounted(CheckSubClass) { | 165 | 14.9k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 14.9k | "Derived must subclass RefCounted<Derived>"); | 167 | 14.9k | } |
bssl::RefCounted<bssl::SSLCredential>::RefCounted(bssl::RefCounted<bssl::SSLCredential>::CheckSubClass) Line | Count | Source | 164 | 122k | RefCounted(CheckSubClass) { | 165 | 122k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 122k | "Derived must subclass RefCounted<Derived>"); | 167 | 122k | } |
bssl::RefCounted<bssl::SSLContext>::RefCounted(bssl::RefCounted<bssl::SSLContext>::CheckSubClass) Line | Count | Source | 164 | 4.98k | RefCounted(CheckSubClass) { | 165 | 4.98k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 4.98k | "Derived must subclass RefCounted<Derived>"); | 167 | 4.98k | } |
bssl::RefCounted<bssl::SSLSession>::RefCounted(bssl::RefCounted<bssl::SSLSession>::CheckSubClass) Line | Count | Source | 164 | 252k | RefCounted(CheckSubClass) { | 165 | 252k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 252k | "Derived must subclass RefCounted<Derived>"); | 167 | 252k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::RefCounted(bssl::RefCounted<bssl::DHImpl>::CheckSubClass) Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::RefCounted(bssl::RefCounted<bssl::ECCustomGroup>::CheckSubClass) bssl::RefCounted<bssl::ECKey>::RefCounted(bssl::RefCounted<bssl::ECKey>::CheckSubClass) Line | Count | Source | 164 | 64.1k | RefCounted(CheckSubClass) { | 165 | 64.1k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 64.1k | "Derived must subclass RefCounted<Derived>"); | 167 | 64.1k | } |
bssl::RefCounted<bssl::RSAImpl>::RefCounted(bssl::RefCounted<bssl::RSAImpl>::CheckSubClass) Line | Count | Source | 164 | 146k | RefCounted(CheckSubClass) { | 165 | 146k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 146k | "Derived must subclass RefCounted<Derived>"); | 167 | 146k | } |
bssl::RefCounted<bssl::Bio>::RefCounted(bssl::RefCounted<bssl::Bio>::CheckSubClass) Line | Count | Source | 164 | 77.6k | RefCounted(CheckSubClass) { | 165 | 77.6k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 77.6k | "Derived must subclass RefCounted<Derived>"); | 167 | 77.6k | } |
bssl::RefCounted<bssl::EvpPkey>::RefCounted(bssl::RefCounted<bssl::EvpPkey>::CheckSubClass) Line | Count | Source | 164 | 272k | RefCounted(CheckSubClass) { | 165 | 272k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 272k | "Derived must subclass RefCounted<Derived>"); | 167 | 272k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPool>::CheckSubClass) Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPoolHandle>::CheckSubClass) bssl::RefCounted<bssl::X509Store>::RefCounted(bssl::RefCounted<bssl::X509Store>::CheckSubClass) Line | Count | Source | 164 | 4.98k | RefCounted(CheckSubClass) { | 165 | 4.98k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 4.98k | "Derived must subclass RefCounted<Derived>"); | 167 | 4.98k | } |
bssl::RefCounted<bssl::X509Impl>::RefCounted(bssl::RefCounted<bssl::X509Impl>::CheckSubClass) Line | Count | Source | 164 | 235k | RefCounted(CheckSubClass) { | 165 | 235k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 235k | "Derived must subclass RefCounted<Derived>"); | 167 | 235k | } |
bssl::RefCounted<bssl::DSAImpl>::RefCounted(bssl::RefCounted<bssl::DSAImpl>::CheckSubClass) Line | Count | Source | 164 | 6.71k | RefCounted(CheckSubClass) { | 165 | 6.71k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 6.71k | "Derived must subclass RefCounted<Derived>"); | 167 | 6.71k | } |
|
168 | | |
169 | 1.20M | ~RefCounted() { BSSL_CHECK(references_.load() == 0); }bssl::RefCounted<bssl::SSLECHKeys>::~RefCounted() Line | Count | Source | 169 | 14.9k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLCredential>::~RefCounted() Line | Count | Source | 169 | 122k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLContext>::~RefCounted() Line | Count | Source | 169 | 4.97k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLSession>::~RefCounted() Line | Count | Source | 169 | 252k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::~RefCounted() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::~RefCounted() bssl::RefCounted<bssl::ECKey>::~RefCounted() Line | Count | Source | 169 | 64.1k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::RSAImpl>::~RefCounted() Line | Count | Source | 169 | 146k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::Bio>::~RefCounted() Line | Count | Source | 169 | 77.6k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::EvpPkey>::~RefCounted() Line | Count | Source | 169 | 272k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::~RefCounted() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::~RefCounted() bssl::RefCounted<bssl::X509Store>::~RefCounted() Line | Count | Source | 169 | 4.97k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::X509Impl>::~RefCounted() Line | Count | Source | 169 | 235k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::DSAImpl>::~RefCounted() Line | Count | Source | 169 | 6.71k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
|
170 | | |
171 | | private: |
172 | | mutable CRYPTO_refcount_t references_ = 1; |
173 | | }; |
174 | | |
175 | | |
176 | | // Containers. |
177 | | |
178 | | // Array<T> is an owning array of elements of `T`. |
179 | | template <typename T> |
180 | | class Array { |
181 | | public: |
182 | | using value_type = std::remove_cv_t<T>; |
183 | | |
184 | | // Array's default constructor creates an empty array. |
185 | 8.34M | Array() {}bssl::Array<unsigned char>::Array() Line | Count | Source | 185 | 7.04M | Array() {} |
bssl::Array<unsigned short>::Array() Line | Count | Source | 185 | 780k | Array() {} |
bssl::Array<bool>::Array() Line | Count | Source | 185 | 167k | Array() {} |
Unexecuted instantiation: bssl::Array<unsigned long>::Array() bssl::Array<unsigned int>::Array() Line | Count | Source | 185 | 63.8k | Array() {} |
bssl::Array<bssl::SSLCredential*>::Array() Line | Count | Source | 185 | 20.9k | Array() {} |
bssl::Array<int>::Array() Line | Count | Source | 185 | 5.12k | Array() {} |
bssl::Array<crypto_iovec_st>::Array() Line | Count | Source | 185 | 4.19k | Array() {} |
bssl::Array<cbs_st>::Array() Line | Count | Source | 185 | 251k | Array() {} |
|
186 | | Array(const Array &) = delete; |
187 | 544k | Array(Array &&other) { *this = std::move(other); }bssl::Array<unsigned char>::Array(bssl::Array<unsigned char>&&) Line | Count | Source | 187 | 460k | Array(Array &&other) { *this = std::move(other); } |
bssl::Array<bool>::Array(bssl::Array<bool>&&) Line | Count | Source | 187 | 83.5k | Array(Array &&other) { *this = std::move(other); } |
|
188 | | |
189 | 8.88M | ~Array() { Reset(); }bssl::Array<unsigned char>::~Array() Line | Count | Source | 189 | 7.50M | ~Array() { Reset(); } |
bssl::Array<unsigned short>::~Array() Line | Count | Source | 189 | 780k | ~Array() { Reset(); } |
bssl::Array<bool>::~Array() Line | Count | Source | 189 | 250k | ~Array() { Reset(); } |
bssl::Array<unsigned int>::~Array() Line | Count | Source | 189 | 63.7k | ~Array() { Reset(); } |
Unexecuted instantiation: bssl::Array<unsigned long>::~Array() bssl::Array<bssl::SSLCredential*>::~Array() Line | Count | Source | 189 | 20.9k | ~Array() { Reset(); } |
bssl::Array<int>::~Array() Line | Count | Source | 189 | 5.12k | ~Array() { Reset(); } |
bssl::Array<crypto_iovec_st>::~Array() Line | Count | Source | 189 | 4.19k | ~Array() { Reset(); } |
bssl::Array<cbs_st>::~Array() Line | Count | Source | 189 | 251k | ~Array() { Reset(); } |
|
190 | | |
191 | | Array &operator=(const Array &) = delete; |
192 | 736k | Array &operator=(Array &&other) { |
193 | 736k | Reset(); |
194 | 736k | other.Release(&data_, &size_); |
195 | 736k | return *this; |
196 | 736k | } bssl::Array<unsigned char>::operator=(bssl::Array<unsigned char>&&) Line | Count | Source | 192 | 537k | Array &operator=(Array &&other) { | 193 | 537k | Reset(); | 194 | 537k | other.Release(&data_, &size_); | 195 | 537k | return *this; | 196 | 537k | } |
bssl::Array<unsigned short>::operator=(bssl::Array<unsigned short>&&) Line | Count | Source | 192 | 31.1k | Array &operator=(Array &&other) { | 193 | 31.1k | Reset(); | 194 | 31.1k | other.Release(&data_, &size_); | 195 | 31.1k | return *this; | 196 | 31.1k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::operator=(bssl::Array<unsigned int>&&) bssl::Array<bool>::operator=(bssl::Array<bool>&&) Line | Count | Source | 192 | 167k | Array &operator=(Array &&other) { | 193 | 167k | Reset(); | 194 | 167k | other.Release(&data_, &size_); | 195 | 167k | return *this; | 196 | 167k | } |
|
197 | | |
198 | 3.88M | const T *data() const { return data_; }bssl::Array<unsigned char>::data() const Line | Count | Source | 198 | 3.17M | const T *data() const { return data_; } |
bssl::Array<bool>::data() const Line | Count | Source | 198 | 122k | const T *data() const { return data_; } |
bssl::Array<unsigned short>::data() const Line | Count | Source | 198 | 469k | const T *data() const { return data_; } |
bssl::Array<unsigned int>::data() const Line | Count | Source | 198 | 117k | const T *data() const { return data_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::data() const |
199 | 353k | T *data() { return data_; }bssl::Array<unsigned char>::data() Line | Count | Source | 199 | 348k | T *data() { return data_; } |
bssl::Array<unsigned short>::data() Line | Count | Source | 199 | 4.11k | T *data() { return data_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::data() |
200 | 9.30M | size_t size() const { return size_; }bssl::Array<unsigned char>::size() const Line | Count | Source | 200 | 7.41M | size_t size() const { return size_; } |
bssl::Array<bool>::size() const Line | Count | Source | 200 | 206k | size_t size() const { return size_; } |
bssl::Array<unsigned short>::size() const Line | Count | Source | 200 | 1.57M | size_t size() const { return size_; } |
bssl::Array<unsigned int>::size() const Line | Count | Source | 200 | 117k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::size() const |
201 | 3.08M | bool empty() const { return size_ == 0; }bssl::Array<unsigned char>::empty() const Line | Count | Source | 201 | 2.80M | bool empty() const { return size_ == 0; } |
bssl::Array<unsigned short>::empty() const Line | Count | Source | 201 | 172k | bool empty() const { return size_ == 0; } |
bssl::Array<bssl::SSLCredential*>::empty() const Line | Count | Source | 201 | 12.4k | bool empty() const { return size_ == 0; } |
bssl::Array<bool>::empty() const Line | Count | Source | 201 | 83.5k | bool empty() const { return size_ == 0; } |
bssl::Array<crypto_iovec_st>::empty() const Line | Count | Source | 201 | 16.7k | bool empty() const { return size_ == 0; } |
|
202 | | |
203 | 2.18M | const T &operator[](size_t i) const { |
204 | 2.18M | BSSL_CHECK(i < size_); |
205 | 2.18M | return data_[i]; |
206 | 2.18M | } bssl::Array<bool>::operator[](unsigned long) const Line | Count | Source | 203 | 170k | const T &operator[](size_t i) const { | 204 | 170k | BSSL_CHECK(i < size_); | 205 | 170k | return data_[i]; | 206 | 170k | } |
bssl::Array<unsigned char>::operator[](unsigned long) const Line | Count | Source | 203 | 2.01M | const T &operator[](size_t i) const { | 204 | 2.01M | BSSL_CHECK(i < size_); | 205 | 2.01M | return data_[i]; | 206 | 2.01M | } |
|
207 | 10.5M | T &operator[](size_t i) { |
208 | 10.5M | BSSL_CHECK(i < size_); |
209 | 10.5M | return data_[i]; |
210 | 10.5M | } bssl::Array<unsigned short>::operator[](unsigned long) Line | Count | Source | 207 | 2.17M | T &operator[](size_t i) { | 208 | 2.17M | BSSL_CHECK(i < size_); | 209 | 2.17M | return data_[i]; | 210 | 2.17M | } |
bssl::Array<unsigned char>::operator[](unsigned long) Line | Count | Source | 207 | 1.83M | T &operator[](size_t i) { | 208 | 1.83M | BSSL_CHECK(i < size_); | 209 | 1.83M | return data_[i]; | 210 | 1.83M | } |
Unexecuted instantiation: bssl::Array<unsigned long>::operator[](unsigned long) Unexecuted instantiation: bssl::Array<unsigned int>::operator[](unsigned long) bssl::Array<int>::operator[](unsigned long) Line | Count | Source | 207 | 880k | T &operator[](size_t i) { | 208 | 880k | BSSL_CHECK(i < size_); | 209 | 880k | return data_[i]; | 210 | 880k | } |
bssl::Array<bool>::operator[](unsigned long) Line | Count | Source | 207 | 155k | T &operator[](size_t i) { | 208 | 155k | BSSL_CHECK(i < size_); | 209 | 155k | return data_[i]; | 210 | 155k | } |
bssl::Array<bssl::SSLCredential*>::operator[](unsigned long) Line | Count | Source | 207 | 20.9k | T &operator[](size_t i) { | 208 | 20.9k | BSSL_CHECK(i < size_); | 209 | 20.9k | return data_[i]; | 210 | 20.9k | } |
bssl::Array<cbs_st>::operator[](unsigned long) Line | Count | Source | 207 | 5.48M | T &operator[](size_t i) { | 208 | 5.48M | BSSL_CHECK(i < size_); | 209 | 5.48M | return data_[i]; | 210 | 5.48M | } |
|
211 | | |
212 | | T &front() { |
213 | | BSSL_CHECK(size_ != 0); |
214 | | return data_[0]; |
215 | | } |
216 | | const T &front() const { |
217 | | BSSL_CHECK(size_ != 0); |
218 | | return data_[0]; |
219 | | } |
220 | 73.7k | T &back() { |
221 | 73.7k | BSSL_CHECK(size_ != 0); |
222 | 73.7k | return data_[size_ - 1]; |
223 | 73.7k | } |
224 | | const T &back() const { |
225 | | BSSL_CHECK(size_ != 0); |
226 | | return data_[size_ - 1]; |
227 | | } |
228 | | |
229 | 501k | T *begin() { return data_; }bssl::Array<unsigned short>::begin() Line | Count | Source | 229 | 220k | T *begin() { return data_; } |
bssl::Array<bssl::SSLCredential*>::begin() Line | Count | Source | 229 | 20.9k | T *begin() { return data_; } |
bssl::Array<unsigned char>::begin() Line | Count | Source | 229 | 8.50k | T *begin() { return data_; } |
bssl::Array<cbs_st>::begin() Line | Count | Source | 229 | 251k | T *begin() { return data_; } |
|
230 | 0 | const T *begin() const { return data_; } |
231 | 509k | T *end() { return data_ + size_; }bssl::Array<unsigned short>::end() Line | Count | Source | 231 | 220k | T *end() { return data_ + size_; } |
bssl::Array<bssl::SSLCredential*>::end() Line | Count | Source | 231 | 20.9k | T *end() { return data_ + size_; } |
bssl::Array<unsigned char>::end() Line | Count | Source | 231 | 17.0k | T *end() { return data_ + size_; } |
bssl::Array<cbs_st>::end() Line | Count | Source | 231 | 251k | T *end() { return data_ + size_; } |
|
232 | 0 | const T *end() const { return data_ + size_; } |
233 | | |
234 | 12.5M | void Reset() { Reset(nullptr, 0); }bssl::Array<unsigned char>::Reset() Line | Count | Source | 234 | 10.1M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<unsigned short>::Reset() Line | Count | Source | 234 | 1.18M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bool>::Reset() Line | Count | Source | 234 | 506k | void Reset() { Reset(nullptr, 0); } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset() bssl::Array<unsigned int>::Reset() Line | Count | Source | 234 | 133k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bssl::SSLCredential*>::Reset() Line | Count | Source | 234 | 41.9k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<int>::Reset() Line | Count | Source | 234 | 10.2k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<crypto_iovec_st>::Reset() Line | Count | Source | 234 | 8.39k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<cbs_st>::Reset() Line | Count | Source | 234 | 503k | void Reset() { Reset(nullptr, 0); } |
|
235 | | |
236 | | // Reset releases the current contents of the array and takes ownership of the |
237 | | // raw pointer supplied by the caller. |
238 | 13.6M | void Reset(T *new_data, size_t new_size) { |
239 | 13.6M | std::destroy_n(data_, size_); |
240 | 13.6M | OPENSSL_free(data_); |
241 | 13.6M | data_ = new_data; |
242 | 13.6M | size_ = new_size; |
243 | 13.6M | } bssl::Array<unsigned char>::Reset(unsigned char*, unsigned long) Line | Count | Source | 238 | 11.2M | void Reset(T *new_data, size_t new_size) { | 239 | 11.2M | std::destroy_n(data_, size_); | 240 | 11.2M | OPENSSL_free(data_); | 241 | 11.2M | data_ = new_data; | 242 | 11.2M | size_ = new_size; | 243 | 11.2M | } |
bssl::Array<unsigned short>::Reset(unsigned short*, unsigned long) Line | Count | Source | 238 | 1.18M | void Reset(T *new_data, size_t new_size) { | 239 | 1.18M | std::destroy_n(data_, size_); | 240 | 1.18M | OPENSSL_free(data_); | 241 | 1.18M | data_ = new_data; | 242 | 1.18M | size_ = new_size; | 243 | 1.18M | } |
bssl::Array<bool>::Reset(bool*, unsigned long) Line | Count | Source | 238 | 506k | void Reset(T *new_data, size_t new_size) { | 239 | 506k | std::destroy_n(data_, size_); | 240 | 506k | OPENSSL_free(data_); | 241 | 506k | data_ = new_data; | 242 | 506k | size_ = new_size; | 243 | 506k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset(unsigned long*, unsigned long) bssl::Array<unsigned int>::Reset(unsigned int*, unsigned long) Line | Count | Source | 238 | 133k | void Reset(T *new_data, size_t new_size) { | 239 | 133k | std::destroy_n(data_, size_); | 240 | 133k | OPENSSL_free(data_); | 241 | 133k | data_ = new_data; | 242 | 133k | size_ = new_size; | 243 | 133k | } |
bssl::Array<bssl::SSLCredential*>::Reset(bssl::SSLCredential**, unsigned long) Line | Count | Source | 238 | 41.9k | void Reset(T *new_data, size_t new_size) { | 239 | 41.9k | std::destroy_n(data_, size_); | 240 | 41.9k | OPENSSL_free(data_); | 241 | 41.9k | data_ = new_data; | 242 | 41.9k | size_ = new_size; | 243 | 41.9k | } |
bssl::Array<int>::Reset(int*, unsigned long) Line | Count | Source | 238 | 10.2k | void Reset(T *new_data, size_t new_size) { | 239 | 10.2k | std::destroy_n(data_, size_); | 240 | 10.2k | OPENSSL_free(data_); | 241 | 10.2k | data_ = new_data; | 242 | 10.2k | size_ = new_size; | 243 | 10.2k | } |
bssl::Array<crypto_iovec_st>::Reset(crypto_iovec_st*, unsigned long) Line | Count | Source | 238 | 8.39k | void Reset(T *new_data, size_t new_size) { | 239 | 8.39k | std::destroy_n(data_, size_); | 240 | 8.39k | OPENSSL_free(data_); | 241 | 8.39k | data_ = new_data; | 242 | 8.39k | size_ = new_size; | 243 | 8.39k | } |
bssl::Array<cbs_st>::Reset(cbs_st*, unsigned long) Line | Count | Source | 238 | 503k | void Reset(T *new_data, size_t new_size) { | 239 | 503k | std::destroy_n(data_, size_); | 240 | 503k | OPENSSL_free(data_); | 241 | 503k | data_ = new_data; | 242 | 503k | size_ = new_size; | 243 | 503k | } |
|
244 | | |
245 | | // Release releases ownership of the array to a raw pointer supplied by the |
246 | | // caller. |
247 | 736k | void Release(T **out, size_t *out_size) { |
248 | 736k | *out = data_; |
249 | 736k | *out_size = size_; |
250 | 736k | data_ = nullptr; |
251 | 736k | size_ = 0; |
252 | 736k | } bssl::Array<unsigned char>::Release(unsigned char**, unsigned long*) Line | Count | Source | 247 | 537k | void Release(T **out, size_t *out_size) { | 248 | 537k | *out = data_; | 249 | 537k | *out_size = size_; | 250 | 537k | data_ = nullptr; | 251 | 537k | size_ = 0; | 252 | 537k | } |
bssl::Array<unsigned short>::Release(unsigned short**, unsigned long*) Line | Count | Source | 247 | 31.1k | void Release(T **out, size_t *out_size) { | 248 | 31.1k | *out = data_; | 249 | 31.1k | *out_size = size_; | 250 | 31.1k | data_ = nullptr; | 251 | 31.1k | size_ = 0; | 252 | 31.1k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Release(unsigned int**, unsigned long*) bssl::Array<bool>::Release(bool**, unsigned long*) Line | Count | Source | 247 | 167k | void Release(T **out, size_t *out_size) { | 248 | 167k | *out = data_; | 249 | 167k | *out_size = size_; | 250 | 167k | data_ = nullptr; | 251 | 167k | size_ = 0; | 252 | 167k | } |
|
253 | | |
254 | | // Init replaces the array with a newly-allocated array of `new_size` |
255 | | // value-constructed copies of `T`. It returns true on success and false on |
256 | | // error. If `T` is a primitive type like `uint8_t`, value-construction means |
257 | | // it will be zero-initialized. |
258 | 347k | [[nodiscard]] bool Init(size_t new_size) { |
259 | 347k | if (!InitUninitialized(new_size)) { |
260 | 0 | return false; |
261 | 0 | } |
262 | 347k | std::uninitialized_value_construct_n(data_, size_); |
263 | 347k | return true; |
264 | 347k | } Unexecuted instantiation: bssl::Array<unsigned long>::Init(unsigned long) bssl::Array<unsigned int>::Init(unsigned long) Line | Count | Source | 258 | 10.9k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 10.9k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 10.9k | std::uninitialized_value_construct_n(data_, size_); | 263 | 10.9k | return true; | 264 | 10.9k | } |
bssl::Array<unsigned char>::Init(unsigned long) Line | Count | Source | 258 | 79.7k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 79.7k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 79.7k | std::uninitialized_value_construct_n(data_, size_); | 263 | 79.7k | return true; | 264 | 79.7k | } |
bssl::Array<int>::Init(unsigned long) Line | Count | Source | 258 | 5.12k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 5.12k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 5.12k | std::uninitialized_value_construct_n(data_, size_); | 263 | 5.12k | return true; | 264 | 5.12k | } |
Unexecuted instantiation: bssl::Array<bool>::Init(unsigned long) bssl::Array<cbs_st>::Init(unsigned long) Line | Count | Source | 258 | 251k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 251k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 251k | std::uninitialized_value_construct_n(data_, size_); | 263 | 251k | return true; | 264 | 251k | } |
|
265 | | |
266 | | // InitForOverwrite behaves like `Init` but it default-constructs each element |
267 | | // instead. This means that, if `T` is a primitive type, the array will be |
268 | | // uninitialized and thus must be filled in by the caller. |
269 | 368k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { |
270 | 368k | if (!InitUninitialized(new_size)) { |
271 | 0 | return false; |
272 | 0 | } |
273 | 368k | std::uninitialized_default_construct_n(data_, size_); |
274 | 368k | return true; |
275 | 368k | } bssl::Array<unsigned char>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 154k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 154k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 154k | std::uninitialized_default_construct_n(data_, size_); | 274 | 154k | return true; | 275 | 154k | } |
bssl::Array<unsigned short>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 173k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 173k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 173k | std::uninitialized_default_construct_n(data_, size_); | 274 | 173k | return true; | 275 | 173k | } |
bssl::Array<bool>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 19.7k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 19.7k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 19.7k | std::uninitialized_default_construct_n(data_, size_); | 274 | 19.7k | return true; | 275 | 19.7k | } |
bssl::Array<bssl::SSLCredential*>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 20.9k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 20.9k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 20.9k | std::uninitialized_default_construct_n(data_, size_); | 274 | 20.9k | return true; | 275 | 20.9k | } |
|
276 | | |
277 | | // CopyFrom replaces the array with a newly-allocated copy of `in`. It returns |
278 | | // true on success and false on error. |
279 | | // |
280 | | // `in` may not alias `this`. |
281 | 1.79M | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
282 | 1.79M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
283 | 1.79M | if (!InitUninitialized(in.size())) { |
284 | 0 | return false; |
285 | 0 | } |
286 | 1.79M | std::uninitialized_copy(in.begin(), in.end(), data_); |
287 | 1.79M | return true; |
288 | 1.79M | } bssl::Array<unsigned char>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 281 | 1.47M | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 1.47M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 1.47M | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 1.47M | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 1.47M | return true; | 288 | 1.47M | } |
bssl::Array<bool>::CopyFrom(bssl::Span<bool const, 18446744073709551615ul>) Line | Count | Source | 281 | 63.8k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 63.8k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 63.8k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 63.8k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 63.8k | return true; | 288 | 63.8k | } |
bssl::Array<unsigned short>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) Line | Count | Source | 281 | 191k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 191k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 191k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 191k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 191k | return true; | 288 | 191k | } |
bssl::Array<unsigned int>::CopyFrom(bssl::Span<unsigned int const, 18446744073709551615ul>) Line | Count | Source | 281 | 58.8k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 58.8k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 58.8k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 58.8k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 58.8k | return true; | 288 | 58.8k | } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::CopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) |
289 | | |
290 | | // Shrink shrinks the stored size of the array to `new_size`. It crashes if |
291 | | // the new size is larger. Note this does not shrink the allocation itself. |
292 | 23.3k | void Shrink(size_t new_size) { |
293 | 23.3k | if (new_size > size_) { |
294 | 0 | abort(); |
295 | 0 | } |
296 | 23.3k | std::destroy_n(data_ + new_size, size_ - new_size); |
297 | 23.3k | size_ = new_size; |
298 | 23.3k | } Unexecuted instantiation: bssl::Array<unsigned char>::Shrink(unsigned long) bssl::Array<unsigned short>::Shrink(unsigned long) Line | Count | Source | 292 | 3.63k | void Shrink(size_t new_size) { | 293 | 3.63k | if (new_size > size_) { | 294 | 0 | abort(); | 295 | 0 | } | 296 | 3.63k | std::destroy_n(data_ + new_size, size_ - new_size); | 297 | 3.63k | size_ = new_size; | 298 | 3.63k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Shrink(unsigned long) bssl::Array<bool>::Shrink(unsigned long) Line | Count | Source | 292 | 19.7k | void Shrink(size_t new_size) { | 293 | 19.7k | if (new_size > size_) { | 294 | 0 | abort(); | 295 | 0 | } | 296 | 19.7k | std::destroy_n(data_ + new_size, size_ - new_size); | 297 | 19.7k | size_ = new_size; | 298 | 19.7k | } |
|
299 | | |
300 | | private: |
301 | | // InitUninitialized replaces the array with a newly-allocated array of |
302 | | // `new_size` elements, but whose constructor has not yet run. On success, the |
303 | | // elements must be constructed before returning control to the caller. |
304 | 2.50M | bool InitUninitialized(size_t new_size) { |
305 | 2.50M | Reset(); |
306 | 2.50M | if (new_size == 0) { |
307 | 1.04M | return true; |
308 | 1.04M | } |
309 | | |
310 | 1.46M | if (new_size > SIZE_MAX / sizeof(T)) { |
311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
312 | 0 | return false; |
313 | 0 | } |
314 | 1.46M | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); |
315 | 1.46M | if (data_ == nullptr) { |
316 | 0 | return false; |
317 | 0 | } |
318 | 1.46M | size_ = new_size; |
319 | 1.46M | return true; |
320 | 1.46M | } bssl::Array<unsigned char>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 1.71M | bool InitUninitialized(size_t new_size) { | 305 | 1.71M | Reset(); | 306 | 1.71M | if (new_size == 0) { | 307 | 928k | return true; | 308 | 928k | } | 309 | | | 310 | 785k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 785k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 785k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 785k | size_ = new_size; | 319 | 785k | return true; | 320 | 785k | } |
bssl::Array<unsigned short>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 364k | bool InitUninitialized(size_t new_size) { | 305 | 364k | Reset(); | 306 | 364k | if (new_size == 0) { | 307 | 119k | return true; | 308 | 119k | } | 309 | | | 310 | 245k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 245k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 245k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 245k | size_ = new_size; | 319 | 245k | return true; | 320 | 245k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::InitUninitialized(unsigned long) bssl::Array<unsigned int>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 69.7k | bool InitUninitialized(size_t new_size) { | 305 | 69.7k | Reset(); | 306 | 69.7k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 69.7k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 69.7k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 69.7k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 69.7k | size_ = new_size; | 319 | 69.7k | return true; | 320 | 69.7k | } |
bssl::Array<int>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 5.12k | bool InitUninitialized(size_t new_size) { | 305 | 5.12k | Reset(); | 306 | 5.12k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 5.12k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 5.12k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 5.12k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 5.12k | size_ = new_size; | 319 | 5.12k | return true; | 320 | 5.12k | } |
bssl::Array<bool>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 83.5k | bool InitUninitialized(size_t new_size) { | 305 | 83.5k | Reset(); | 306 | 83.5k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 83.5k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 83.5k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 83.5k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 83.5k | size_ = new_size; | 319 | 83.5k | return true; | 320 | 83.5k | } |
bssl::Array<bssl::SSLCredential*>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 20.9k | bool InitUninitialized(size_t new_size) { | 305 | 20.9k | Reset(); | 306 | 20.9k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 20.9k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 20.9k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 20.9k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 20.9k | size_ = new_size; | 319 | 20.9k | return true; | 320 | 20.9k | } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::InitUninitialized(unsigned long) bssl::Array<cbs_st>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 251k | bool InitUninitialized(size_t new_size) { | 305 | 251k | Reset(); | 306 | 251k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 251k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 251k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 251k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 251k | size_ = new_size; | 319 | 251k | return true; | 320 | 251k | } |
|
321 | | |
322 | | T *data_ = nullptr; |
323 | | size_t size_ = 0; |
324 | | }; |
325 | | |
326 | | // Vector<T> is a resizable array of elements of `T`. |
327 | | template <typename T> |
328 | | class Vector { |
329 | | public: |
330 | 551k | Vector() = default; bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 14.9k | Vector() = default; |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::Vector() Line | Count | Source | 330 | 97.2k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 63.8k | Vector() = default; |
bssl::Vector<bssl::Array<unsigned char> >::Vector() Line | Count | Source | 330 | 122k | Vector() = default; |
bssl::Vector<bssl::CertCompressionAlg>::Vector() Line | Count | Source | 330 | 4.98k | Vector() = default; |
bssl::Vector<bssl::ALPSConfig>::Vector() Line | Count | Source | 330 | 58.8k | Vector() = default; |
bssl::Vector<unsigned char>::Vector() Line | Count | Source | 330 | 49.9k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 67.0k | Vector() = default; |
bssl::Vector<unsigned long>::Vector() Line | Count | Source | 330 | 67.0k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 4.98k | Vector() = default; |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Vector() |
331 | | Vector(const Vector &) = delete; |
332 | 49.9k | Vector(Vector &&other) { *this = std::move(other); }bssl::Vector<unsigned char>::Vector(bssl::Vector<unsigned char>&&) Line | Count | Source | 332 | 49.9k | Vector(Vector &&other) { *this = std::move(other); } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
333 | 601k | ~Vector() { clear(); }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 14.9k | ~Vector() { clear(); } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::~Vector() Line | Count | Source | 333 | 97.2k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 63.7k | ~Vector() { clear(); } |
bssl::Vector<bssl::Array<unsigned char> >::~Vector() Line | Count | Source | 333 | 122k | ~Vector() { clear(); } |
bssl::Vector<bssl::CertCompressionAlg>::~Vector() Line | Count | Source | 333 | 4.97k | ~Vector() { clear(); } |
bssl::Vector<bssl::ALPSConfig>::~Vector() Line | Count | Source | 333 | 58.8k | ~Vector() { clear(); } |
bssl::Vector<unsigned char>::~Vector() Line | Count | Source | 333 | 99.8k | ~Vector() { clear(); } |
bssl::Vector<unsigned long>::~Vector() Line | Count | Source | 333 | 67.0k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 67.0k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 4.97k | ~Vector() { clear(); } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::~Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::~Vector() |
334 | | |
335 | | Vector &operator=(const Vector &) = delete; |
336 | 49.9k | Vector &operator=(Vector &&other) { |
337 | 49.9k | clear(); |
338 | 49.9k | std::swap(data_, other.data_); |
339 | 49.9k | std::swap(size_, other.size_); |
340 | 49.9k | std::swap(capacity_, other.capacity_); |
341 | 49.9k | return *this; |
342 | 49.9k | } bssl::Vector<unsigned char>::operator=(bssl::Vector<unsigned char>&&) Line | Count | Source | 336 | 49.9k | Vector &operator=(Vector &&other) { | 337 | 49.9k | clear(); | 338 | 49.9k | std::swap(data_, other.data_); | 339 | 49.9k | std::swap(size_, other.size_); | 340 | 49.9k | std::swap(capacity_, other.capacity_); | 341 | 49.9k | return *this; | 342 | 49.9k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::operator=(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator=(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
343 | | |
344 | 49.2k | const T *data() const { return data_; }bssl::Vector<unsigned char>::data() const Line | Count | Source | 344 | 49.2k | const T *data() const { return data_; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() const |
345 | 0 | T *data() { return data_; }Unexecuted instantiation: bssl::Vector<unsigned char>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::data() |
346 | 29.8M | size_t size() const { return size_; }bssl::Vector<bssl::CertCompressionAlg>::size() const Line | Count | Source | 346 | 73 | size_t size() const { return size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::size() const Line | Count | Source | 346 | 39 | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::size() const Line | Count | Source | 346 | 41.9k | size_t size() const { return size_; } |
bssl::Vector<unsigned char>::size() const Line | Count | Source | 346 | 113k | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::size() const Line | Count | Source | 346 | 29.6M | size_t size() const { return size_; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::size() const Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::size() const |
347 | 17.8M | bool empty() const { return size_ == 0; }bssl::Vector<bssl::ALPSConfig>::empty() const Line | Count | Source | 347 | 107k | bool empty() const { return size_ == 0; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::empty() const Line | Count | Source | 347 | 109k | bool empty() const { return size_ == 0; } |
bssl::Vector<unsigned long>::empty() const Line | Count | Source | 347 | 17.6M | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::empty() const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::empty() const |
348 | | |
349 | 0 | const T &operator[](size_t i) const { |
350 | 0 | BSSL_CHECK(i < size_); |
351 | 0 | return data_[i]; |
352 | 0 | } Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::operator[](unsigned long) const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) const |
353 | 29.6M | T &operator[](size_t i) { |
354 | 29.6M | BSSL_CHECK(i < size_); |
355 | 29.6M | return data_[i]; |
356 | 29.6M | } bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::operator[](unsigned long) Line | Count | Source | 353 | 38 | T &operator[](size_t i) { | 354 | 38 | BSSL_CHECK(i < size_); | 355 | 38 | return data_[i]; | 356 | 38 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::operator[](unsigned long) Line | Count | Source | 353 | 29.6M | T &operator[](size_t i) { | 354 | 29.6M | BSSL_CHECK(i < size_); | 355 | 29.6M | return data_[i]; | 356 | 29.6M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator[](unsigned long) |
357 | | |
358 | | T &front() { |
359 | | BSSL_CHECK(size_ != 0); |
360 | | return data_[0]; |
361 | | } |
362 | | const T &front() const { |
363 | | BSSL_CHECK(size_ != 0); |
364 | | return data_[0]; |
365 | | } |
366 | 17.6M | T &back() { |
367 | 17.6M | BSSL_CHECK(size_ != 0); |
368 | 17.6M | return data_[size_ - 1]; |
369 | 17.6M | } bssl::Vector<unsigned long>::back() Line | Count | Source | 366 | 17.6M | T &back() { | 367 | 17.6M | BSSL_CHECK(size_ != 0); | 368 | 17.6M | return data_[size_ - 1]; | 369 | 17.6M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::back() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::back() |
370 | | const T &back() const { |
371 | | BSSL_CHECK(size_ != 0); |
372 | | return data_[size_ - 1]; |
373 | | } |
374 | | |
375 | 411k | T *begin() { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 445 | T *begin() { return data_; } |
bssl::Vector<bssl::CertCompressionAlg>::begin() Line | Count | Source | 375 | 53.5k | T *begin() { return data_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::begin() Line | Count | Source | 375 | 1.66k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 265k | T *begin() { return data_; } |
bssl::Vector<bssl::ALPSConfig>::begin() Line | Count | Source | 375 | 76 | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::begin() bssl::Vector<unsigned char>::begin() Line | Count | Source | 375 | 3.70k | T *begin() { return data_; } |
bssl::Vector<unsigned long>::begin() Line | Count | Source | 375 | 41.6k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 44.2k | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::begin() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::begin() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::begin() |
376 | 52.8k | const T *begin() const { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() const Line | Count | Source | 376 | 6 | const T *begin() const { return data_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::begin() const Line | Count | Source | 376 | 1.20k | const T *begin() const { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() const Line | Count | Source | 376 | 51.6k | const T *begin() const { return data_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::begin() const Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::begin() const |
377 | 411k | T *end() { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 445 | T *end() { return data_ + size_; } |
bssl::Vector<bssl::CertCompressionAlg>::end() Line | Count | Source | 377 | 53.5k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::end() Line | Count | Source | 377 | 1.66k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 265k | T *end() { return data_ + size_; } |
bssl::Vector<bssl::ALPSConfig>::end() Line | Count | Source | 377 | 76 | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::end() bssl::Vector<unsigned char>::end() Line | Count | Source | 377 | 3.70k | T *end() { return data_ + size_; } |
bssl::Vector<unsigned long>::end() Line | Count | Source | 377 | 41.6k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 44.2k | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::end() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::end() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::end() |
378 | 52.8k | const T *end() const { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() const Line | Count | Source | 378 | 6 | const T *end() const { return data_ + size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::end() const Line | Count | Source | 378 | 1.20k | const T *end() const { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() const Line | Count | Source | 378 | 51.6k | const T *end() const { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::end() const Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::end() const |
379 | | |
380 | 787k | void clear() { |
381 | 787k | std::destroy_n(data_, size_); |
382 | 787k | OPENSSL_free(data_); |
383 | 787k | data_ = nullptr; |
384 | 787k | size_ = 0; |
385 | 787k | capacity_ = 0; |
386 | 787k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 14.9k | void clear() { | 381 | 14.9k | std::destroy_n(data_, size_); | 382 | 14.9k | OPENSSL_free(data_); | 383 | 14.9k | data_ = nullptr; | 384 | 14.9k | size_ = 0; | 385 | 14.9k | capacity_ = 0; | 386 | 14.9k | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::clear() Line | Count | Source | 380 | 143k | void clear() { | 381 | 143k | std::destroy_n(data_, size_); | 382 | 143k | OPENSSL_free(data_); | 383 | 143k | data_ = nullptr; | 384 | 143k | size_ = 0; | 385 | 143k | capacity_ = 0; | 386 | 143k | } |
bssl::Vector<bssl::ALPSConfig>::clear() Line | Count | Source | 380 | 58.8k | void clear() { | 381 | 58.8k | std::destroy_n(data_, size_); | 382 | 58.8k | OPENSSL_free(data_); | 383 | 58.8k | data_ = nullptr; | 384 | 58.8k | size_ = 0; | 385 | 58.8k | capacity_ = 0; | 386 | 58.8k | } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 63.7k | void clear() { | 381 | 63.7k | std::destroy_n(data_, size_); | 382 | 63.7k | OPENSSL_free(data_); | 383 | 63.7k | data_ = nullptr; | 384 | 63.7k | size_ = 0; | 385 | 63.7k | capacity_ = 0; | 386 | 63.7k | } |
bssl::Vector<bssl::Array<unsigned char> >::clear() Line | Count | Source | 380 | 122k | void clear() { | 381 | 122k | std::destroy_n(data_, size_); | 382 | 122k | OPENSSL_free(data_); | 383 | 122k | data_ = nullptr; | 384 | 122k | size_ = 0; | 385 | 122k | capacity_ = 0; | 386 | 122k | } |
bssl::Vector<bssl::CertCompressionAlg>::clear() Line | Count | Source | 380 | 4.97k | void clear() { | 381 | 4.97k | std::destroy_n(data_, size_); | 382 | 4.97k | OPENSSL_free(data_); | 383 | 4.97k | data_ = nullptr; | 384 | 4.97k | size_ = 0; | 385 | 4.97k | capacity_ = 0; | 386 | 4.97k | } |
bssl::Vector<unsigned char>::clear() Line | Count | Source | 380 | 153k | void clear() { | 381 | 153k | std::destroy_n(data_, size_); | 382 | 153k | OPENSSL_free(data_); | 383 | 153k | data_ = nullptr; | 384 | 153k | size_ = 0; | 385 | 153k | capacity_ = 0; | 386 | 153k | } |
bssl::Vector<unsigned long>::clear() Line | Count | Source | 380 | 108k | void clear() { | 381 | 108k | std::destroy_n(data_, size_); | 382 | 108k | OPENSSL_free(data_); | 383 | 108k | data_ = nullptr; | 384 | 108k | size_ = 0; | 385 | 108k | capacity_ = 0; | 386 | 108k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 111k | void clear() { | 381 | 111k | std::destroy_n(data_, size_); | 382 | 111k | OPENSSL_free(data_); | 383 | 111k | data_ = nullptr; | 384 | 111k | size_ = 0; | 385 | 111k | capacity_ = 0; | 386 | 111k | } |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 4.97k | void clear() { | 381 | 4.97k | std::destroy_n(data_, size_); | 382 | 4.97k | OPENSSL_free(data_); | 383 | 4.97k | data_ = nullptr; | 384 | 4.97k | size_ = 0; | 385 | 4.97k | capacity_ = 0; | 386 | 4.97k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::clear() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::clear() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::clear() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::clear() |
387 | | |
388 | 17.6M | void pop_back() { |
389 | 17.6M | BSSL_CHECK(size_ != 0); |
390 | 17.6M | std::destroy_at(&data_[size_ - 1]); |
391 | 17.6M | size_--; |
392 | 17.6M | } |
393 | | |
394 | | // Push adds `elem` at the end of the internal array, growing if necessary. It |
395 | | // returns false when allocation fails. |
396 | 17.9M | [[nodiscard]] bool Push(T elem) { |
397 | 17.9M | if (!MaybeGrow(1)) { |
398 | 0 | return false; |
399 | 0 | } |
400 | 17.9M | new (&data_[size_]) T(std::move(elem)); |
401 | 17.9M | size_++; |
402 | 17.9M | return true; |
403 | 17.9M | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>) Line | Count | Source | 396 | 6 | [[nodiscard]] bool Push(T elem) { | 397 | 6 | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 6 | new (&data_[size_]) T(std::move(elem)); | 401 | 6 | size_++; | 402 | 6 | return true; | 403 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::Push(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >) Line | Count | Source | 396 | 365 | [[nodiscard]] bool Push(T elem) { | 397 | 365 | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 365 | new (&data_[size_]) T(std::move(elem)); | 401 | 365 | size_++; | 402 | 365 | return true; | 403 | 365 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::Push(bssl::Array<unsigned char>) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::Push(bssl::ALPSConfig) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::Push(bssl::CertCompressionAlg) bssl::Vector<unsigned long>::Push(unsigned long) Line | Count | Source | 396 | 17.6M | [[nodiscard]] bool Push(T elem) { | 397 | 17.6M | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 17.6M | new (&data_[size_]) T(std::move(elem)); | 401 | 17.6M | size_++; | 402 | 17.6M | return true; | 403 | 17.6M | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bignum_st, bssl::internal::Deleter>) Line | Count | Source | 396 | 268k | [[nodiscard]] bool Push(T elem) { | 397 | 268k | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 268k | new (&data_[size_]) T(std::move(elem)); | 401 | 268k | size_++; | 402 | 268k | return true; | 403 | 268k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::Push(bssl::ByDirEntry::CRLSuffix) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Push(bssl::(anonymous namespace)::X509PolicyNode) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter>) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Push(bssl::(anonymous namespace)::X509PolicyLevel) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Push(v3_ext_method const*) |
404 | | |
405 | | // CopyFrom replaces the contents of the array with a copy of `in`. It returns |
406 | | // true on success and false on allocation error. |
407 | 0 | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
408 | 0 | Array<T> copy; |
409 | 0 | if (!copy.CopyFrom(in)) { |
410 | 0 | return false; |
411 | 0 | } |
412 | | |
413 | 0 | clear(); |
414 | 0 | copy.Release(&data_, &size_); |
415 | 0 | capacity_ = size_; |
416 | 0 | return true; |
417 | 0 | } |
418 | | |
419 | | // Append appends the contents of `in` to the array. It returns true on |
420 | | // success and false on allocation error. |
421 | 46.7k | [[nodiscard]] bool Append(Span<const T> in) { |
422 | 46.7k | if (!MaybeGrow(in.size())) { |
423 | 0 | return false; |
424 | 0 | } |
425 | 46.7k | std::uninitialized_copy(in.begin(), in.end(), data_ + size_); |
426 | 46.7k | size_ += in.size(); |
427 | 46.7k | return true; |
428 | 46.7k | } |
429 | | |
430 | | // AppendMove moves the contents of `in` and appends them to the array. It |
431 | | // returns true on success and false on allocation error. |
432 | 0 | [[nodiscard]] bool AppendMove(Span<T> in) { |
433 | 0 | if (!MaybeGrow(in.size())) { |
434 | 0 | return false; |
435 | 0 | } |
436 | 0 | std::uninitialized_move(in.begin(), in.end(), data_ + size_); |
437 | 0 | size_ += in.size(); |
438 | 0 | return true; |
439 | 0 | } |
440 | | |
441 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
442 | | template <typename Pred> |
443 | 651 | void EraseIf(Pred pred) { |
444 | 651 | auto it = std::remove_if(begin(), end(), pred); |
445 | 651 | std::destroy(it, end()); |
446 | 651 | size_ = it - begin(); |
447 | 651 | } tls13_client.cc:void bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::EraseIf<bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1>(bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1) Line | Count | Source | 443 | 651 | void EraseIf(Pred pred) { | 444 | 651 | auto it = std::remove_if(begin(), end(), pred); | 445 | 651 | std::destroy(it, end()); | 446 | 651 | size_ = it - begin(); | 447 | 651 | } |
Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0>(bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0) Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0>(bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0) |
448 | | |
449 | | private: |
450 | | // If there is no room for `num` elements, creates a new backing array with |
451 | | // double the size of the old one and copies elements over. |
452 | 17.9M | [[nodiscard]] bool MaybeGrow(size_t num) { |
453 | 17.9M | constexpr size_t kDefaultSize = 16; |
454 | 17.9M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); |
455 | 17.9M | if (num > kMaxCapacity - size_) { |
456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
457 | 0 | return false; |
458 | 0 | } |
459 | 17.9M | size_t new_capacity = size_ + num; |
460 | | // No need to grow if we have room. |
461 | 17.9M | if (capacity_ >= new_capacity) { |
462 | 17.8M | return true; |
463 | 17.8M | } |
464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at |
465 | | // the start. |
466 | 89.9k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); |
467 | | // At least double the old capacity for linear amortized behavior. |
468 | 89.9k | if (capacity_ <= kMaxCapacity / 2) { |
469 | 89.9k | new_capacity = std::max(new_capacity, capacity_ * 2); |
470 | 89.9k | } |
471 | 89.9k | T *new_data = |
472 | 89.9k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); |
473 | 89.9k | if (new_data == nullptr) { |
474 | 0 | return false; |
475 | 0 | } |
476 | 89.9k | size_t new_size = size_; |
477 | 89.9k | std::uninitialized_move(begin(), end(), new_data); |
478 | 89.9k | clear(); |
479 | 89.9k | data_ = new_data; |
480 | 89.9k | size_ = new_size; |
481 | 89.9k | capacity_ = new_capacity; |
482 | 89.9k | return true; |
483 | 89.9k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 6 | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 6 | constexpr size_t kDefaultSize = 16; | 454 | 6 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 6 | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 6 | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 6 | if (capacity_ >= new_capacity) { | 462 | 0 | return true; | 463 | 0 | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 6 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 6 | if (capacity_ <= kMaxCapacity / 2) { | 469 | 6 | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 6 | } | 471 | 6 | T *new_data = | 472 | 6 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 6 | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 6 | size_t new_size = size_; | 477 | 6 | std::uninitialized_move(begin(), end(), new_data); | 478 | 6 | clear(); | 479 | 6 | data_ = new_data; | 480 | 6 | size_ = new_size; | 481 | 6 | capacity_ = new_capacity; | 482 | 6 | return true; | 483 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 365 | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 365 | constexpr size_t kDefaultSize = 16; | 454 | 365 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 365 | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 365 | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 365 | if (capacity_ >= new_capacity) { | 462 | 0 | return true; | 463 | 0 | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 365 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 365 | if (capacity_ <= kMaxCapacity / 2) { | 469 | 365 | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 365 | } | 471 | 365 | T *new_data = | 472 | 365 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 365 | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 365 | size_t new_size = size_; | 477 | 365 | std::uninitialized_move(begin(), end(), new_data); | 478 | 365 | clear(); | 479 | 365 | data_ = new_data; | 480 | 365 | size_ = new_size; | 481 | 365 | capacity_ = new_capacity; | 482 | 365 | return true; | 483 | 365 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::MaybeGrow(unsigned long) bssl::Vector<unsigned char>::MaybeGrow(unsigned long) Line | Count | Source | 452 | 46.7k | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 46.7k | constexpr size_t kDefaultSize = 16; | 454 | 46.7k | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 46.7k | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 46.7k | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 46.7k | if (capacity_ >= new_capacity) { | 462 | 43.0k | return true; | 463 | 43.0k | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 3.70k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 3.70k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 3.70k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 3.70k | } | 471 | 3.70k | T *new_data = | 472 | 3.70k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 3.70k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 3.70k | size_t new_size = size_; | 477 | 3.70k | std::uninitialized_move(begin(), end(), new_data); | 478 | 3.70k | clear(); | 479 | 3.70k | data_ = new_data; | 480 | 3.70k | size_ = new_size; | 481 | 3.70k | capacity_ = new_capacity; | 482 | 3.70k | return true; | 483 | 3.70k | } |
bssl::Vector<unsigned long>::MaybeGrow(unsigned long) Line | Count | Source | 452 | 17.6M | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 17.6M | constexpr size_t kDefaultSize = 16; | 454 | 17.6M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 17.6M | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 17.6M | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 17.6M | if (capacity_ >= new_capacity) { | 462 | 17.6M | return true; | 463 | 17.6M | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 41.6k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 41.6k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 41.6k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 41.6k | } | 471 | 41.6k | T *new_data = | 472 | 41.6k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 41.6k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 41.6k | size_t new_size = size_; | 477 | 41.6k | std::uninitialized_move(begin(), end(), new_data); | 478 | 41.6k | clear(); | 479 | 41.6k | data_ = new_data; | 480 | 41.6k | size_ = new_size; | 481 | 41.6k | capacity_ = new_capacity; | 482 | 41.6k | return true; | 483 | 41.6k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 268k | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 268k | constexpr size_t kDefaultSize = 16; | 454 | 268k | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 268k | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 268k | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 268k | if (capacity_ >= new_capacity) { | 462 | 224k | return true; | 463 | 224k | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 44.2k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 44.2k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 44.2k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 44.2k | } | 471 | 44.2k | T *new_data = | 472 | 44.2k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 44.2k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 44.2k | size_t new_size = size_; | 477 | 44.2k | std::uninitialized_move(begin(), end(), new_data); | 478 | 44.2k | clear(); | 479 | 44.2k | data_ = new_data; | 480 | 44.2k | size_ = new_size; | 481 | 44.2k | capacity_ = new_capacity; | 482 | 44.2k | return true; | 483 | 44.2k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::MaybeGrow(unsigned long) |
484 | | |
485 | | // data_ is a pointer to `capacity_` objects of size `T`, the first `size_` of |
486 | | // which are constructed. |
487 | | T *data_ = nullptr; |
488 | | // `size_` is the number of elements stored in this Vector. |
489 | | size_t size_ = 0; |
490 | | // `capacity_` is the number of elements allocated in this Vector. |
491 | | size_t capacity_ = 0; |
492 | | }; |
493 | | |
494 | | // A PackedSize is an integer that can store values from 0 to N, represented as |
495 | | // a minimal-width integer. |
496 | | template <size_t N> |
497 | | using PackedSize = std::conditional_t< |
498 | | N <= 0xff, uint8_t, |
499 | | std::conditional_t<N <= 0xffff, uint16_t, |
500 | | std::conditional_t<N <= 0xffffffff, uint32_t, size_t>>>; |
501 | | |
502 | | // An InplaceVector is like a Vector, but stores up to N elements inline in the |
503 | | // object. It is inspired by std::inplace_vector in C++26. |
504 | | template <typename T, size_t N> |
505 | | class InplaceVector { |
506 | | public: |
507 | | using value_type = std::remove_cv_t<T>; |
508 | | |
509 | 3.12M | InplaceVector() = default; bssl::InplaceVector<unsigned short, 2ul>::InplaceVector() Line | Count | Source | 509 | 52.1k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 2ul>::InplaceVector() Line | Count | Source | 509 | 276k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 48ul>::InplaceVector() Line | Count | Source | 509 | 1.47M | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::InplaceVector() Line | Count | Source | 509 | 97.2k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 32ul>::InplaceVector() Line | Count | Source | 509 | 789k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 12ul>::InplaceVector() Line | Count | Source | 509 | 369k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::InplaceVector() Line | Count | Source | 509 | 20.3k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::InplaceVector() Line | Count | Source | 509 | 10.8k | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::InplaceVector() Line | Count | Source | 509 | 18.0k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::InplaceVector() Line | Count | Source | 509 | 18.0k | InplaceVector() = default; |
bssl::InplaceVector<crypto_iovec_st, 16ul>::InplaceVector() Line | Count | Source | 509 | 4.19k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::InplaceVector() |
510 | 34.3k | InplaceVector(const InplaceVector &other) { *this = other; } |
511 | 42.1k | InplaceVector(InplaceVector &&other) { *this = std::move(other); } |
512 | 3.20M | ~InplaceVector() { clear(); }bssl::InplaceVector<unsigned char, 48ul>::~InplaceVector() Line | Count | Source | 512 | 1.54M | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned short, 2ul>::~InplaceVector() Line | Count | Source | 512 | 52.1k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 2ul>::~InplaceVector() Line | Count | Source | 512 | 276k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::~InplaceVector() Line | Count | Source | 512 | 97.2k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 32ul>::~InplaceVector() Line | Count | Source | 512 | 789k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 12ul>::~InplaceVector() Line | Count | Source | 512 | 369k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::~InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::~InplaceVector() Line | Count | Source | 512 | 20.3k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::~InplaceVector() Line | Count | Source | 512 | 10.8k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::~InplaceVector() Line | Count | Source | 512 | 18.0k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::~InplaceVector() Line | Count | Source | 512 | 18.0k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::~InplaceVector() Line | Count | Source | 512 | 4.19k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::~InplaceVector() |
513 | 286k | InplaceVector &operator=(const InplaceVector &other) { |
514 | 286k | if (this != &other) { |
515 | 286k | CopyFrom(other); |
516 | 286k | } |
517 | 286k | return *this; |
518 | 286k | } bssl::InplaceVector<unsigned char, 32ul>::operator=(bssl::InplaceVector<unsigned char, 32ul> const&) Line | Count | Source | 513 | 156k | InplaceVector &operator=(const InplaceVector &other) { | 514 | 156k | if (this != &other) { | 515 | 156k | CopyFrom(other); | 516 | 156k | } | 517 | 156k | return *this; | 518 | 156k | } |
bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul> const&) Line | Count | Source | 513 | 130k | InplaceVector &operator=(const InplaceVector &other) { | 514 | 130k | if (this != &other) { | 515 | 130k | CopyFrom(other); | 516 | 130k | } | 517 | 130k | return *this; | 518 | 130k | } |
|
519 | 113k | InplaceVector &operator=(InplaceVector &&other) { |
520 | 113k | clear(); |
521 | 113k | std::uninitialized_move(other.begin(), other.end(), data()); |
522 | 113k | size_ = other.size(); |
523 | 113k | return *this; |
524 | 113k | } bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul>&&) Line | Count | Source | 519 | 113k | InplaceVector &operator=(InplaceVector &&other) { | 520 | 113k | clear(); | 521 | 113k | std::uninitialized_move(other.begin(), other.end(), data()); | 522 | 113k | size_ = other.size(); | 523 | 113k | return *this; | 524 | 113k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::operator=(bssl::InplaceVector<unsigned char, 2ul>&&) |
525 | | |
526 | 2.80M | const T *data() const { return reinterpret_cast<const T *>(storage_); }bssl::InplaceVector<unsigned char, 2ul>::data() const Line | Count | Source | 526 | 235k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::data() const bssl::InplaceVector<unsigned short, 2ul>::data() const Line | Count | Source | 526 | 51.6k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 48ul>::data() const Line | Count | Source | 526 | 930k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() const Line | Count | Source | 526 | 187k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() const Line | Count | Source | 526 | 1.38M | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() const bssl::InplaceVector<crypto_iovec_st, 16ul>::data() const Line | Count | Source | 526 | 8.39k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
|
527 | 8.54M | T *data() { return reinterpret_cast<T *>(storage_); }bssl::InplaceVector<unsigned char, 48ul>::data() Line | Count | Source | 527 | 3.37M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 2ul>::data() Line | Count | Source | 527 | 772k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() Line | Count | Source | 527 | 882k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::data() Line | Count | Source | 527 | 327k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned short, 2ul>::data() Line | Count | Source | 527 | 362k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() Line | Count | Source | 527 | 2.09M | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::data() Line | Count | Source | 527 | 230k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::data() Line | Count | Source | 527 | 209k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::data() Line | Count | Source | 527 | 33.8k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::data() Line | Count | Source | 527 | 243k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::data() Line | Count | Source | 527 | 16.7k | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::data() |
528 | 4.29M | size_t size() const { return size_; }bssl::InplaceVector<unsigned char, 12ul>::size() const Line | Count | Source | 528 | 442k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::size() const bssl::InplaceVector<unsigned short, 2ul>::size() const Line | Count | Source | 528 | 155k | size_t size() const { return size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::size() const Line | Count | Source | 528 | 109k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 2ul>::size() const Line | Count | Source | 528 | 293k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 48ul>::size() const Line | Count | Source | 528 | 1.28M | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 32ul>::size() const Line | Count | Source | 528 | 1.44M | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::size() const bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::size() const Line | Count | Source | 528 | 185k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::size() const Line | Count | Source | 528 | 316k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::size() const Line | Count | Source | 528 | 47.0k | size_t size() const { return size_; } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::size() const Line | Count | Source | 528 | 12.5k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::size() const Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::size() const bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::size() const Line | Count | Source | 528 | 7.95k | size_t size() const { return size_; } |
|
529 | 2.03M | static constexpr size_t capacity() { return N; }bssl::InplaceVector<unsigned char, 2ul>::capacity() Line | Count | Source | 529 | 122k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned short, 2ul>::capacity() Line | Count | Source | 529 | 103k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::capacity() Line | Count | Source | 529 | 109k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 32ul>::capacity() Line | Count | Source | 529 | 658k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 48ul>::capacity() Line | Count | Source | 529 | 622k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 12ul>::capacity() Line | Count | Source | 529 | 266k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::capacity() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::capacity() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::capacity() Line | Count | Source | 529 | 31.2k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::capacity() Line | Count | Source | 529 | 90.4k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::capacity() Line | Count | Source | 529 | 20.1k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::capacity() bssl::InplaceVector<crypto_iovec_st, 16ul>::capacity() Line | Count | Source | 529 | 4.19k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::capacity() bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::capacity() Line | Count | Source | 529 | 7.95k | static constexpr size_t capacity() { return N; } |
|
530 | 490k | bool empty() const { return size_ == 0; }bssl::InplaceVector<unsigned char, 12ul>::empty() const Line | Count | Source | 530 | 78.1k | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::empty() const bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::empty() const Line | Count | Source | 530 | 4.06k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 2ul>::empty() const Line | Count | Source | 530 | 268k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 48ul>::empty() const Line | Count | Source | 530 | 2.54k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 32ul>::empty() const Line | Count | Source | 530 | 120k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::empty() const Line | Count | Source | 530 | 15.7k | bool empty() const { return size_ == 0; } |
|
531 | | |
532 | | const T &operator[](size_t i) const { |
533 | | BSSL_CHECK(i < size_); |
534 | | return data()[i]; |
535 | | } |
536 | 507k | T &operator[](size_t i) { |
537 | 507k | BSSL_CHECK(i < size_); |
538 | 507k | return data()[i]; |
539 | 507k | } bssl::InplaceVector<unsigned short, 2ul>::operator[](unsigned long) Line | Count | Source | 536 | 206k | T &operator[](size_t i) { | 537 | 206k | BSSL_CHECK(i < size_); | 538 | 206k | return data()[i]; | 539 | 206k | } |
bssl::InplaceVector<unsigned char, 2ul>::operator[](unsigned long) Line | Count | Source | 536 | 53.5k | T &operator[](size_t i) { | 537 | 53.5k | BSSL_CHECK(i < size_); | 538 | 53.5k | return data()[i]; | 539 | 53.5k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::operator[](unsigned long) Line | Count | Source | 536 | 9.34k | T &operator[](size_t i) { | 537 | 9.34k | BSSL_CHECK(i < size_); | 538 | 9.34k | return data()[i]; | 539 | 9.34k | } |
bssl::InplaceVector<unsigned char, 12ul>::operator[](unsigned long) Line | Count | Source | 536 | 46.8k | T &operator[](size_t i) { | 537 | 46.8k | BSSL_CHECK(i < size_); | 538 | 46.8k | return data()[i]; | 539 | 46.8k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::operator[](unsigned long) Line | Count | Source | 536 | 76.3k | T &operator[](size_t i) { | 537 | 76.3k | BSSL_CHECK(i < size_); | 538 | 76.3k | return data()[i]; | 539 | 76.3k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::operator[](unsigned long) Line | Count | Source | 536 | 2.82k | T &operator[](size_t i) { | 537 | 2.82k | BSSL_CHECK(i < size_); | 538 | 2.82k | return data()[i]; | 539 | 2.82k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::operator[](unsigned long) Line | Count | Source | 536 | 112k | T &operator[](size_t i) { | 537 | 112k | BSSL_CHECK(i < size_); | 538 | 112k | return data()[i]; | 539 | 112k | } |
|
540 | | |
541 | | T &front() { |
542 | | BSSL_CHECK(size_ != 0); |
543 | | return data()[0]; |
544 | | } |
545 | | const T &front() const { |
546 | | BSSL_CHECK(size_ != 0); |
547 | | return data()[0]; |
548 | | } |
549 | | T &back() { |
550 | | BSSL_CHECK(size_ != 0); |
551 | | return data()[size_ - 1]; |
552 | | } |
553 | | const T &back() const { |
554 | | BSSL_CHECK(size_ != 0); |
555 | | return data()[size_ - 1]; |
556 | | } |
557 | | |
558 | 300k | T *begin() { return data(); }bssl::InplaceVector<unsigned char, 48ul>::begin() Line | Count | Source | 558 | 113k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::begin() Line | Count | Source | 558 | 2.45k | T *begin() { return data(); } |
bssl::InplaceVector<unsigned char, 2ul>::begin() Line | Count | Source | 558 | 51.4k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::begin() Line | Count | Source | 558 | 4.63k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::begin() Line | Count | Source | 558 | 19.4k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::begin() Line | Count | Source | 558 | 108k | T *begin() { return data(); } |
|
559 | | const T *begin() const { return data(); } |
560 | 311k | T *end() { return data() + size_; }bssl::InplaceVector<unsigned char, 48ul>::end() Line | Count | Source | 560 | 113k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::end() Line | Count | Source | 560 | 4.90k | T *end() { return data() + size_; } |
bssl::InplaceVector<unsigned char, 2ul>::end() Line | Count | Source | 560 | 98.5k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::end() Line | Count | Source | 560 | 4.63k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::end() Line | Count | Source | 560 | 19.4k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::end() Line | Count | Source | 560 | 69.7k | T *end() { return data() + size_; } |
|
561 | | const T *end() const { return data() + size_; } |
562 | | |
563 | 4.89M | void clear() { Shrink(0); }bssl::InplaceVector<unsigned char, 48ul>::clear() Line | Count | Source | 563 | 2.17M | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::clear() Line | Count | Source | 563 | 200k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned short, 2ul>::clear() Line | Count | Source | 563 | 52.1k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 2ul>::clear() Line | Count | Source | 563 | 445k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 32ul>::clear() Line | Count | Source | 563 | 1.34M | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 12ul>::clear() Line | Count | Source | 563 | 557k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::clear() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::clear() Line | Count | Source | 563 | 33.0k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::clear() Line | Count | Source | 563 | 10.8k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::clear() Line | Count | Source | 563 | 48.1k | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::clear() Line | Count | Source | 563 | 18.0k | void clear() { Shrink(0); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::clear() Line | Count | Source | 563 | 8.39k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::clear() |
564 | | |
565 | | void pop_back() { |
566 | | BSSL_CHECK(size_ != 0); |
567 | | Shrink(size_ - 1); |
568 | | } |
569 | | |
570 | | // Shrink resizes the vector to `new_size`, which must not be larger than the |
571 | | // current size. Unlike `Resize`, this can be called when `T` is not |
572 | | // default-constructible. |
573 | 4.93M | void Shrink(size_t new_size) { |
574 | 4.93M | BSSL_CHECK(new_size <= size_); |
575 | 4.93M | std::destroy_n(data() + new_size, size_ - new_size); |
576 | 4.93M | size_ = static_cast<PackedSize<N>>(new_size); |
577 | 4.93M | } bssl::InplaceVector<unsigned char, 48ul>::Shrink(unsigned long) Line | Count | Source | 573 | 2.17M | void Shrink(size_t new_size) { | 574 | 2.17M | BSSL_CHECK(new_size <= size_); | 575 | 2.17M | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 2.17M | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 2.17M | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::Shrink(unsigned long) Line | Count | Source | 573 | 200k | void Shrink(size_t new_size) { | 574 | 200k | BSSL_CHECK(new_size <= size_); | 575 | 200k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 200k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 200k | } |
bssl::InplaceVector<unsigned short, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 52.1k | void Shrink(size_t new_size) { | 574 | 52.1k | BSSL_CHECK(new_size <= size_); | 575 | 52.1k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 52.1k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 52.1k | } |
bssl::InplaceVector<unsigned char, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 445k | void Shrink(size_t new_size) { | 574 | 445k | BSSL_CHECK(new_size <= size_); | 575 | 445k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 445k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 445k | } |
bssl::InplaceVector<unsigned char, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 1.34M | void Shrink(size_t new_size) { | 574 | 1.34M | BSSL_CHECK(new_size <= size_); | 575 | 1.34M | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 1.34M | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 1.34M | } |
bssl::InplaceVector<unsigned char, 12ul>::Shrink(unsigned long) Line | Count | Source | 573 | 557k | void Shrink(size_t new_size) { | 574 | 557k | BSSL_CHECK(new_size <= size_); | 575 | 557k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 557k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 557k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Shrink(unsigned long) bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 33.0k | void Shrink(size_t new_size) { | 574 | 33.0k | BSSL_CHECK(new_size <= size_); | 575 | 33.0k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 33.0k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 33.0k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 10.8k | void Shrink(size_t new_size) { | 574 | 10.8k | BSSL_CHECK(new_size <= size_); | 575 | 10.8k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 10.8k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 10.8k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::Shrink(unsigned long) Line | Count | Source | 573 | 48.1k | void Shrink(size_t new_size) { | 574 | 48.1k | BSSL_CHECK(new_size <= size_); | 575 | 48.1k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 48.1k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 48.1k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 57.1k | void Shrink(size_t new_size) { | 574 | 57.1k | BSSL_CHECK(new_size <= size_); | 575 | 57.1k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 57.1k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 57.1k | } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::Shrink(unsigned long) Line | Count | Source | 573 | 8.39k | void Shrink(size_t new_size) { | 574 | 8.39k | BSSL_CHECK(new_size <= size_); | 575 | 8.39k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 8.39k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 8.39k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Shrink(unsigned long) |
578 | | |
579 | | // TryResize resizes the vector to `new_size` and returns true, or returns |
580 | | // false if `new_size` is too large. Any newly-added elements are |
581 | | // value-initialized. |
582 | 6.42k | [[nodiscard]] bool TryResize(size_t new_size) { |
583 | 6.42k | if (new_size <= size_) { |
584 | 0 | Shrink(new_size); |
585 | 0 | return true; |
586 | 0 | } |
587 | 6.42k | if (new_size > capacity()) { |
588 | 0 | return false; |
589 | 0 | } |
590 | 6.42k | std::uninitialized_value_construct_n(data() + size_, new_size - size_); |
591 | 6.42k | size_ = static_cast<PackedSize<N>>(new_size); |
592 | 6.42k | return true; |
593 | 6.42k | } |
594 | | |
595 | | // TryResizeForOverwrite behaves like `TryResize`, but newly-added elements |
596 | | // are default-initialized, so POD types may contain uninitialized values that |
597 | | // the caller is responsible for filling in. |
598 | 207k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { |
599 | 207k | if (new_size <= size_) { |
600 | 149 | Shrink(new_size); |
601 | 149 | return true; |
602 | 149 | } |
603 | 207k | if (new_size > capacity()) { |
604 | 0 | return false; |
605 | 0 | } |
606 | 207k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); |
607 | 207k | size_ = static_cast<PackedSize<N>>(new_size); |
608 | 207k | return true; |
609 | 207k | } bssl::InplaceVector<unsigned char, 32ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 598 | 97.2k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 599 | 97.2k | if (new_size <= size_) { | 600 | 22 | Shrink(new_size); | 601 | 22 | return true; | 602 | 22 | } | 603 | 97.1k | if (new_size > capacity()) { | 604 | 0 | return false; | 605 | 0 | } | 606 | 97.1k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 607 | 97.1k | size_ = static_cast<PackedSize<N>>(new_size); | 608 | 97.1k | return true; | 609 | 97.1k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 598 | 110k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 599 | 110k | if (new_size <= size_) { | 600 | 127 | Shrink(new_size); | 601 | 127 | return true; | 602 | 127 | } | 603 | 110k | if (new_size > capacity()) { | 604 | 0 | return false; | 605 | 0 | } | 606 | 110k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 607 | 110k | size_ = static_cast<PackedSize<N>>(new_size); | 608 | 110k | return true; | 609 | 110k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::TryResizeForOverwrite(unsigned long) |
610 | | |
611 | | // TryCopyFrom sets the vector to a copy of `in` and returns true, or returns |
612 | | // false if `in` is too large. |
613 | | // |
614 | | // `in` may not alias `this`. |
615 | 1.37M | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { |
616 | 1.37M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
617 | 1.37M | if (in.size() > capacity()) { |
618 | 9.20k | return false; |
619 | 9.20k | } |
620 | 1.36M | clear(); |
621 | 1.36M | std::uninitialized_copy(in.begin(), in.end(), data()); |
622 | 1.36M | size_ = in.size(); |
623 | 1.36M | return true; |
624 | 1.37M | } bssl::InplaceVector<unsigned char, 2ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 117k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 117k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 117k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 117k | clear(); | 621 | 117k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 117k | size_ = in.size(); | 623 | 117k | return true; | 624 | 117k | } |
bssl::InplaceVector<unsigned char, 12ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 187k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 187k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 187k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 187k | clear(); | 621 | 187k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 187k | size_ = in.size(); | 623 | 187k | return true; | 624 | 187k | } |
bssl::InplaceVector<unsigned char, 32ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 561k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 561k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 561k | if (in.size() > capacity()) { | 618 | 9.17k | return false; | 619 | 9.17k | } | 620 | 552k | clear(); | 621 | 552k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 552k | size_ = in.size(); | 623 | 552k | return true; | 624 | 561k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 505k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 505k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 505k | if (in.size() > capacity()) { | 618 | 31 | return false; | 619 | 31 | } | 620 | 505k | clear(); | 621 | 505k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 505k | size_ = in.size(); | 623 | 505k | return true; | 624 | 505k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::TryCopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<crypto_iovec_st, 16ul>::TryCopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) Line | Count | Source | 615 | 4.19k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 4.19k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 4.19k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 4.19k | clear(); | 621 | 4.19k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 4.19k | size_ = in.size(); | 623 | 4.19k | return true; | 624 | 4.19k | } |
|
625 | | |
626 | | // TryAppend appends the vector by a copy of `in` and returns true, or |
627 | | // returns false if `in` is too large. |
628 | 0 | [[nodiscard]] bool TryAppend(Span<const T> in) { |
629 | 0 | if (in.size() > capacity() - size()) { |
630 | 0 | return false; |
631 | 0 | } |
632 | 0 | std::uninitialized_copy(in.begin(), in.end(), &data()[size_]); |
633 | 0 | size_ += in.size(); |
634 | 0 | return true; |
635 | 0 | } Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) |
636 | | |
637 | | // TryPushBack appends `val` to the vector and returns a pointer to the |
638 | | // newly-inserted value, or nullptr if the vector is at capacity. |
639 | 367k | [[nodiscard]] T *TryPushBack(T val) { |
640 | 367k | if (size() >= capacity()) { |
641 | 0 | return nullptr; |
642 | 0 | } |
643 | 367k | T *ret = &data()[size_]; |
644 | 367k | new (ret) T(std::move(val)); |
645 | 367k | size_++; |
646 | 367k | return ret; |
647 | 367k | } bssl::InplaceVector<unsigned char, 2ul>::TryPushBack(unsigned char) Line | Count | Source | 639 | 4.98k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 4.98k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 4.98k | T *ret = &data()[size_]; | 644 | 4.98k | new (ret) T(std::move(val)); | 645 | 4.98k | size_++; | 646 | 4.98k | return ret; | 647 | 4.98k | } |
bssl::InplaceVector<unsigned short, 2ul>::TryPushBack(unsigned short) Line | Count | Source | 639 | 103k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 103k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 103k | T *ret = &data()[size_]; | 644 | 103k | new (ret) T(std::move(val)); | 645 | 103k | size_++; | 646 | 103k | return ret; | 647 | 103k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::TryPushBack(std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>) Line | Count | Source | 639 | 109k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 109k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 109k | T *ret = &data()[size_]; | 644 | 109k | new (ret) T(std::move(val)); | 645 | 109k | size_++; | 646 | 109k | return ret; | 647 | 109k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::TryPushBack(bssl::DTLSOutgoingMessage) Line | Count | Source | 639 | 31.2k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 31.2k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 31.2k | T *ret = &data()[size_]; | 644 | 31.2k | new (ret) T(std::move(val)); | 645 | 31.2k | size_++; | 646 | 31.2k | return ret; | 647 | 31.2k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::TryPushBack(bssl::DTLSRecordNumber) Line | Count | Source | 639 | 90.4k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 90.4k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 90.4k | T *ret = &data()[size_]; | 644 | 90.4k | new (ret) T(std::move(val)); | 645 | 90.4k | size_++; | 646 | 90.4k | return ret; | 647 | 90.4k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::TryPushBack(bssl::DTLSSentRecord) Line | Count | Source | 639 | 20.1k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 20.1k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 20.1k | T *ret = &data()[size_]; | 644 | 20.1k | new (ret) T(std::move(val)); | 645 | 20.1k | size_++; | 646 | 20.1k | return ret; | 647 | 20.1k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::TryPushBack(std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>) Line | Count | Source | 639 | 7.95k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 7.95k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 7.95k | T *ret = &data()[size_]; | 644 | 7.95k | new (ret) T(std::move(val)); | 645 | 7.95k | size_++; | 646 | 7.95k | return ret; | 647 | 7.95k | } |
|
648 | | |
649 | | // The following methods behave like their `Try*` counterparts, but abort the |
650 | | // program on failure. |
651 | 6.42k | void Resize(size_t size) { BSSL_CHECK(TryResize(size)); } |
652 | 207k | void ResizeForOverwrite(size_t size) { |
653 | 207k | BSSL_CHECK(TryResizeForOverwrite(size)); |
654 | 207k | } bssl::InplaceVector<unsigned char, 32ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 652 | 97.2k | void ResizeForOverwrite(size_t size) { | 653 | 97.2k | BSSL_CHECK(TryResizeForOverwrite(size)); | 654 | 97.2k | } |
bssl::InplaceVector<unsigned char, 48ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 652 | 110k | void ResizeForOverwrite(size_t size) { | 653 | 110k | BSSL_CHECK(TryResizeForOverwrite(size)); | 654 | 110k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::ResizeForOverwrite(unsigned long) |
655 | 586k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); }Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 12ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 146k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
bssl::InplaceVector<unsigned char, 32ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 210k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 48ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 225k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::CopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) Line | Count | Source | 655 | 4.19k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
|
656 | 0 | void Append(Span<const T> in) { BSSL_CHECK(TryAppend(in)); }Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) |
657 | 123k | T &PushBack(T val) { |
658 | 123k | T *ret = TryPushBack(std::move(val)); |
659 | 123k | BSSL_CHECK(ret != nullptr); |
660 | 123k | return *ret; |
661 | 123k | } bssl::InplaceVector<unsigned char, 2ul>::PushBack(unsigned char) Line | Count | Source | 657 | 4.98k | T &PushBack(T val) { | 658 | 4.98k | T *ret = TryPushBack(std::move(val)); | 659 | 4.98k | BSSL_CHECK(ret != nullptr); | 660 | 4.98k | return *ret; | 661 | 4.98k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::PushBack(bssl::DTLSRecordNumber) Line | Count | Source | 657 | 90.4k | T &PushBack(T val) { | 658 | 90.4k | T *ret = TryPushBack(std::move(val)); | 659 | 90.4k | BSSL_CHECK(ret != nullptr); | 660 | 90.4k | return *ret; | 661 | 90.4k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::PushBack(bssl::DTLSSentRecord) Line | Count | Source | 657 | 20.1k | T &PushBack(T val) { | 658 | 20.1k | T *ret = TryPushBack(std::move(val)); | 659 | 20.1k | BSSL_CHECK(ret != nullptr); | 660 | 20.1k | return *ret; | 661 | 20.1k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::PushBack(std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>) Line | Count | Source | 657 | 7.95k | T &PushBack(T val) { | 658 | 7.95k | T *ret = TryPushBack(std::move(val)); | 659 | 7.95k | BSSL_CHECK(ret != nullptr); | 660 | 7.95k | return *ret; | 661 | 7.95k | } |
|
662 | | |
663 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
664 | | template <typename Pred> |
665 | 39.1k | void EraseIf(Pred pred) { |
666 | 39.1k | auto it = std::remove_if(begin(), end(), pred); |
667 | 39.1k | Shrink(it - begin()); |
668 | 39.1k | } |
669 | | |
670 | | private: |
671 | | alignas(T) char storage_[sizeof(T[N])]; |
672 | | PackedSize<N> size_ = 0; |
673 | | }; |
674 | | |
675 | | // A MaybeInplaceArray is like an `Array`, but backed by an `InplaceVector` if |
676 | | // `size() <= N`, and by an `Array` if `size() > N`. |
677 | | template <typename T, size_t N> |
678 | | class MaybeInplaceArray { |
679 | | public: |
680 | | // CopyFrom replaces the array with a newly-allocated copy of `in`. It returns |
681 | | // true on success and false on error. |
682 | | // |
683 | | // `in` may not alias `this`. |
684 | 4.19k | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
685 | 4.19k | if (in.size() <= N) { |
686 | 4.19k | small_.CopyFrom(in); |
687 | 4.19k | large_.Reset(); |
688 | 4.19k | } else { |
689 | 0 | if (!large_.CopyFrom(in)) { |
690 | 0 | return false; |
691 | 0 | } |
692 | 0 | small_.clear(); |
693 | 0 | } |
694 | 4.19k | return true; |
695 | 4.19k | } |
696 | | |
697 | | // Minimal methods to allow conversion to a `Span`. |
698 | 4.19k | const T *data() const { return IsSmall() ? small_.data() : large_.data(); } |
699 | 4.19k | T *data() { return IsSmall() ? small_.data() : large_.data(); } |
700 | 8.39k | size_t size() const { return IsSmall() ? small_.size() : large_.size(); } |
701 | | |
702 | | private: |
703 | 16.7k | bool IsSmall() const { return large_.empty(); } |
704 | | |
705 | | // TODO(crbug.com/548222332): Optimize storage by putting this on the stack. |
706 | | // Invariant: at least one of these two is empty. |
707 | | Array<T> large_; |
708 | | InplaceVector<T, N> small_; |
709 | | }; |
710 | | |
711 | | BSSL_NAMESPACE_END |
712 | | |
713 | | #endif // OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |