/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 | | // Note: unlike |new|, this does not support non-public constructors. |
48 | | template <typename T, typename... Args> |
49 | 7.58M | T *New(Args &&...args) { |
50 | 7.58M | void *t = OPENSSL_malloc(sizeof(T)); |
51 | 7.58M | if (t == nullptr) { |
52 | 0 | return nullptr; |
53 | 0 | } |
54 | 7.58M | return new (t) T(std::forward<Args>(args)...); |
55 | 7.58M | } Unexecuted instantiation: bssl::ECHConfig* bssl::New<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) ssl_ech_keys_st* bssl::New<ssl_ech_keys_st>() Line | Count | Source | 49 | 14.9k | T *New(Args &&...args) { | 50 | 14.9k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 14.9k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 14.9k | return new (t) T(std::forward<Args>(args)...); | 55 | 14.9k | } |
bssl::ECHServerConfig* bssl::New<bssl::ECHServerConfig>() Line | Count | Source | 49 | 12.8k | T *New(Args &&...args) { | 50 | 12.8k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 12.8k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 12.8k | return new (t) T(std::forward<Args>(args)...); | 55 | 12.8k | } |
bssl::SSLPAKEShare* bssl::New<bssl::SSLPAKEShare>() Line | Count | Source | 49 | 16 | T *New(Args &&...args) { | 50 | 16 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 16 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 16 | return new (t) T(std::forward<Args>(args)...); | 55 | 16 | } |
Unexecuted instantiation: bssl::spake2plus::Prover* bssl::New<bssl::spake2plus::Prover>() bssl::SSLCipherPreferenceList* bssl::New<bssl::SSLCipherPreferenceList>() Line | Count | Source | 49 | 16.9k | T *New(Args &&...args) { | 50 | 16.9k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 16.9k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 16.9k | return new (t) T(std::forward<Args>(args)...); | 55 | 16.9k | } |
bssl::SSL_HANDSHAKE_HINTS* bssl::New<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 49 | 74.7k | T *New(Args &&...args) { | 50 | 74.7k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 74.7k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 74.7k | return new (t) T(std::forward<Args>(args)...); | 55 | 74.7k | } |
bssl::SSL_HANDSHAKE* bssl::New<bssl::SSL_HANDSHAKE, ssl_st*&>(ssl_st*&) Line | Count | Source | 49 | 140k | T *New(Args &&...args) { | 50 | 140k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 140k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 140k | return new (t) T(std::forward<Args>(args)...); | 55 | 140k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 49 | 218k | T *New(Args &&...args) { | 50 | 218k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 218k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 218k | return new (t) T(std::forward<Args>(args)...); | 55 | 218k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 49 | 117k | T *New(Args &&...args) { | 50 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 117k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 117k | return new (t) T(std::forward<Args>(args)...); | 55 | 117k | } |
ssl_credential_st* bssl::New<ssl_credential_st, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 49 | 114k | T *New(Args &&...args) { | 50 | 114k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 114k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 114k | return new (t) T(std::forward<Args>(args)...); | 55 | 114k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 49 | 109k | T *New(Args &&...args) { | 50 | 109k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 109k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 109k | return new (t) T(std::forward<Args>(args)...); | 55 | 109k | } |
Unexecuted instantiation: ssl_credential_st* bssl::New<ssl_credential_st, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) ssl_credential_st* bssl::New<ssl_credential_st, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 49 | 109k | T *New(Args &&...args) { | 50 | 109k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 109k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 109k | return new (t) T(std::forward<Args>(args)...); | 55 | 109k | } |
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 | 49 | 17.4k | T *New(Args &&...args) { | 50 | 17.4k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 17.4k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 17.4k | return new (t) T(std::forward<Args>(args)...); | 55 | 17.4k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519KeyShare* bssl::New<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 49 | 66.1k | T *New(Args &&...args) { | 50 | 66.1k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 66.1k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 66.1k | return new (t) T(std::forward<Args>(args)...); | 55 | 66.1k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519Kyber768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519Kyber768KeyShare>() Line | Count | Source | 49 | 241 | T *New(Args &&...args) { | 50 | 241 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 241 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 241 | return new (t) T(std::forward<Args>(args)...); | 55 | 241 | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519MLKEM768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 49 | 44.3k | T *New(Args &&...args) { | 50 | 44.3k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 44.3k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 44.3k | return new (t) T(std::forward<Args>(args)...); | 55 | 44.3k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::MLKEM1024KeyShare* bssl::New<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 49 | 12 | T *New(Args &&...args) { | 50 | 12 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 12 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 12 | return new (t) T(std::forward<Args>(args)...); | 55 | 12 | } |
ssl_ctx_st* bssl::New<ssl_ctx_st, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 49 | 4.85k | T *New(Args &&...args) { | 50 | 4.85k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 4.85k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 4.85k | return new (t) T(std::forward<Args>(args)...); | 55 | 4.85k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 49 | 4.85k | T *New(Args &&...args) { | 50 | 4.85k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 4.85k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 4.85k | return new (t) T(std::forward<Args>(args)...); | 55 | 4.85k | } |
ssl_st* bssl::New<ssl_st, ssl_ctx_st*&>(ssl_ctx_st*&) Line | Count | Source | 49 | 109k | T *New(Args &&...args) { | 50 | 109k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 109k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 109k | return new (t) T(std::forward<Args>(args)...); | 55 | 109k | } |
bssl::SSL_CONFIG* bssl::New<bssl::SSL_CONFIG, ssl_st*>(ssl_st*&&) Line | Count | Source | 49 | 109k | T *New(Args &&...args) { | 50 | 109k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 109k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 109k | return new (t) T(std::forward<Args>(args)...); | 55 | 109k | } |
bssl::TicketKey* bssl::New<bssl::TicketKey>() Line | Count | Source | 49 | 402 | T *New(Args &&...args) { | 50 | 402 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 402 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 402 | return new (t) T(std::forward<Args>(args)...); | 55 | 402 | } |
ssl_session_st* bssl::New<ssl_session_st, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 49 | 215k | T *New(Args &&...args) { | 50 | 215k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 215k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 215k | return new (t) T(std::forward<Args>(args)...); | 55 | 215k | } |
tls13_enc.cc:bssl::(anonymous namespace)::NullRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 49 | 41.3k | T *New(Args &&...args) { | 50 | 41.3k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 41.3k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 41.3k | return new (t) T(std::forward<Args>(args)...); | 55 | 41.3k | } |
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>() bssl::DTLSIncomingMessage* bssl::New<bssl::DTLSIncomingMessage>() Line | Count | Source | 49 | 49.3k | T *New(Args &&...args) { | 50 | 49.3k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 49.3k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 49.3k | return new (t) T(std::forward<Args>(args)...); | 55 | 49.3k | } |
bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>* bssl::New<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 49 | 10.3k | T *New(Args &&...args) { | 50 | 10.3k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 10.3k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 10.3k | return new (t) T(std::forward<Args>(args)...); | 55 | 10.3k | } |
bssl::DTLS1_STATE* bssl::New<bssl::DTLS1_STATE>() Line | Count | Source | 49 | 38.8k | T *New(Args &&...args) { | 50 | 38.8k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 38.8k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 38.8k | return new (t) T(std::forward<Args>(args)...); | 55 | 38.8k | } |
bssl::DTLSPrevReadEpoch* bssl::New<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 49 | 31.8k | T *New(Args &&...args) { | 50 | 31.8k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 31.8k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 31.8k | return new (t) T(std::forward<Args>(args)...); | 55 | 31.8k | } |
bssl::SSL3_STATE* bssl::New<bssl::SSL3_STATE>() Line | Count | Source | 49 | 109k | T *New(Args &&...args) { | 50 | 109k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 109k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 109k | return new (t) T(std::forward<Args>(args)...); | 55 | 109k | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::keygen_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() Unexecuted instantiation: 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>() 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 | 49 | 648k | T *New(Args &&...args) { | 50 | 648k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 648k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 648k | return new (t) T(std::forward<Args>(args)...); | 55 | 648k | } |
bssl::BignumCtx* bssl::New<bssl::BignumCtx>() Line | Count | Source | 49 | 74.7k | T *New(Args &&...args) { | 50 | 74.7k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 74.7k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 74.7k | return new (t) T(std::forward<Args>(args)...); | 55 | 74.7k | } |
bn_mont_ctx_st* bssl::New<bn_mont_ctx_st>() Line | Count | Source | 49 | 22.0k | T *New(Args &&...args) { | 50 | 22.0k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 22.0k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 22.0k | return new (t) T(std::forward<Args>(args)...); | 55 | 22.0k | } |
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 | 49 | 128k | T *New(Args &&...args) { | 50 | 128k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 128k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 128k | return new (t) T(std::forward<Args>(args)...); | 55 | 128k | } |
bssl::ECKey* bssl::New<bssl::ECKey, engine_st const*&>(engine_st const*&) Line | Count | Source | 49 | 49.1k | T *New(Args &&...args) { | 50 | 49.1k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 49.1k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 49.1k | return new (t) T(std::forward<Args>(args)...); | 55 | 49.1k | } |
hmac_ctx_st* bssl::New<hmac_ctx_st>() Line | Count | Source | 49 | 33.0k | T *New(Args &&...args) { | 50 | 33.0k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 33.0k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 33.0k | return new (t) T(std::forward<Args>(args)...); | 55 | 33.0k | } |
Unexecuted instantiation: 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>() 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>() Unexecuted instantiation: 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>() 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>() bssl::RSAImpl* bssl::New<bssl::RSAImpl, engine_st const*&>(engine_st const*&) Line | Count | Source | 49 | 114k | T *New(Args &&...args) { | 50 | 114k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 114k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 114k | return new (t) T(std::forward<Args>(args)...); | 55 | 114k | } |
bssl::Bio* bssl::New<bssl::Bio, bio_method_st const*&>(bio_method_st const*&) Line | Count | Source | 49 | 71.7k | T *New(Args &&...args) { | 50 | 71.7k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 71.7k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 71.7k | return new (t) T(std::forward<Args>(args)...); | 55 | 71.7k | } |
ecdsa_sig_st* bssl::New<ecdsa_sig_st>() Line | Count | Source | 49 | 13.8k | T *New(Args &&...args) { | 50 | 13.8k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 13.8k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 13.8k | return new (t) T(std::forward<Args>(args)...); | 55 | 13.8k | } |
bssl::EvpPkey* bssl::New<bssl::EvpPkey>() Line | Count | Source | 49 | 214k | T *New(Args &&...args) { | 50 | 214k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 214k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 214k | return new (t) T(std::forward<Args>(args)...); | 55 | 214k | } |
bssl::EvpPkeyCtx* bssl::New<bssl::EvpPkeyCtx>() Line | Count | Source | 49 | 111k | T *New(Args &&...args) { | 50 | 111k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 111k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 111k | return new (t) T(std::forward<Args>(args)...); | 55 | 111k | } |
p_ed25519.cc:(anonymous namespace)::ED25519_KEY* bssl::New<(anonymous namespace)::ED25519_KEY>() Line | Count | Source | 49 | 302 | T *New(Args &&...args) { | 50 | 302 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 302 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 302 | return new (t) T(std::forward<Args>(args)...); | 55 | 302 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::MldsaPkeyCtx* bssl::New<(anonymous namespace)::MldsaPkeyCtx>() p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 49 | 4 | T *New(Args &&...args) { | 50 | 4 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 4 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 4 | return new (t) T(std::forward<Args>(args)...); | 55 | 4 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 49 | 2 | T *New(Args &&...args) { | 50 | 2 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 2 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 2 | return new (t) T(std::forward<Args>(args)...); | 55 | 2 | } |
p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 49 | 6 | T *New(Args &&...args) { | 50 | 6 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 6 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 6 | return new (t) T(std::forward<Args>(args)...); | 55 | 6 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 49 | 3 | T *New(Args &&...args) { | 50 | 3 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 3 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 3 | return new (t) T(std::forward<Args>(args)...); | 55 | 3 | } |
p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 49 | 6 | T *New(Args &&...args) { | 50 | 6 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 6 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 6 | return new (t) T(std::forward<Args>(args)...); | 55 | 6 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 49 | 2 | T *New(Args &&...args) { | 50 | 2 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 2 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 2 | return new (t) T(std::forward<Args>(args)...); | 55 | 2 | } |
p_rsa.cc:(anonymous namespace)::RSA_PKEY_CTX* bssl::New<(anonymous namespace)::RSA_PKEY_CTX>() Line | Count | Source | 49 | 87.8k | T *New(Args &&...args) { | 50 | 87.8k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 87.8k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 87.8k | return new (t) T(std::forward<Args>(args)...); | 55 | 87.8k | } |
p_x25519.cc:(anonymous namespace)::X25519_KEY* bssl::New<(anonymous namespace)::X25519_KEY>() Line | Count | Source | 49 | 346 | T *New(Args &&...args) { | 50 | 346 | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 346 | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 346 | return new (t) T(std::forward<Args>(args)...); | 55 | 346 | } |
Unexecuted instantiation: bssl::crypto_ex_data_func_st* bssl::New<bssl::crypto_ex_data_func_st>() 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_item_st* bssl::New<bssl::lhash_item_st>() Line | Count | Source | 49 | 55.4k | T *New(Args &&...args) { | 50 | 55.4k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 55.4k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 55.4k | return new (t) T(std::forward<Args>(args)...); | 55 | 55.4k | } |
bssl::X509Store* bssl::New<bssl::X509Store>() Line | Count | Source | 49 | 4.85k | T *New(Args &&...args) { | 50 | 4.85k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 4.85k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 4.85k | return new (t) T(std::forward<Args>(args)...); | 55 | 4.85k | } |
Unexecuted instantiation: X509_algor_st* bssl::New<X509_algor_st>() X509_name_entry_st* bssl::New<X509_name_entry_st>() Line | Count | Source | 49 | 698k | T *New(Args &&...args) { | 50 | 698k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 698k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 698k | return new (t) T(std::forward<Args>(args)...); | 55 | 698k | } |
bssl::X509_NAME_CACHE* bssl::New<bssl::X509_NAME_CACHE>() Line | Count | Source | 49 | 314k | T *New(Args &&...args) { | 50 | 314k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 314k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 314k | return new (t) T(std::forward<Args>(args)...); | 55 | 314k | } |
Unexecuted instantiation: X509_pubkey_st* bssl::New<X509_pubkey_st>() asn1_object_st* bssl::New<asn1_object_st>() Line | Count | Source | 49 | 1.67M | T *New(Args &&...args) { | 50 | 1.67M | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 1.67M | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 1.67M | return new (t) T(std::forward<Args>(args)...); | 55 | 1.67M | } |
Unexecuted instantiation: bssl::ASN1_STRING_TABLE* bssl::New<bssl::ASN1_STRING_TABLE>() asn1_string_st* bssl::New<asn1_string_st>() Line | Count | Source | 49 | 977k | T *New(Args &&...args) { | 50 | 977k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 977k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 977k | return new (t) T(std::forward<Args>(args)...); | 55 | 977k | } |
asn1_type_st* bssl::New<asn1_type_st>() Line | Count | Source | 49 | 428k | T *New(Args &&...args) { | 50 | 428k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 428k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 428k | return new (t) T(std::forward<Args>(args)...); | 55 | 428k | } |
bssl::DSAImpl* bssl::New<bssl::DSAImpl>() Line | Count | Source | 49 | 6.81k | T *New(Args &&...args) { | 50 | 6.81k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 6.81k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 6.81k | return new (t) T(std::forward<Args>(args)...); | 55 | 6.81k | } |
Unexecuted instantiation: pkcs12_st* bssl::New<pkcs12_st>() Unexecuted instantiation: bssl::lookup_dir_st* bssl::New<bssl::lookup_dir_st>() Unexecuted instantiation: bssl::lookup_dir_entry_st* bssl::New<bssl::lookup_dir_entry_st>() Unexecuted instantiation: bssl::lookup_dir_hashes_st* bssl::New<bssl::lookup_dir_hashes_st>() bssl::conf_section_st* bssl::New<bssl::conf_section_st>() Line | Count | Source | 49 | 18.5k | T *New(Args &&...args) { | 50 | 18.5k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 18.5k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 18.5k | return new (t) T(std::forward<Args>(args)...); | 55 | 18.5k | } |
conf_st* bssl::New<conf_st>() Line | Count | Source | 49 | 10.5k | T *New(Args &&...args) { | 50 | 10.5k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 10.5k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 10.5k | return new (t) T(std::forward<Args>(args)...); | 55 | 10.5k | } |
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 | 49 | 34.1k | T *New(Args &&...args) { | 50 | 34.1k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 34.1k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 34.1k | return new (t) T(std::forward<Args>(args)...); | 55 | 34.1k | } |
bssl::DTLSWriteEpoch* bssl::New<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 49 | 7.76k | T *New(Args &&...args) { | 50 | 7.76k | void *t = OPENSSL_malloc(sizeof(T)); | 51 | 7.76k | if (t == nullptr) { | 52 | 0 | return nullptr; | 53 | 0 | } | 54 | 7.76k | return new (t) T(std::forward<Args>(args)...); | 55 | 7.76k | } |
|
56 | | |
57 | | // NewZeroed behaves like |new| but uses |OPENSSL_zalloc| for memory |
58 | | // allocation, thereby zeroing the memory prior to calling constructors. It |
59 | | // returns nullptr on allocation error. It only implements single-object |
60 | | // allocation and not new T[n]. |
61 | | // |
62 | | // Note: unlike |new|, this does not support non-public constructors. |
63 | | // |
64 | | // TODO(crbug.com/42220000): Actually replace calls to this by explicitly |
65 | | // setting default values in the structs, or - when it can be shown this is not |
66 | | // necessary - simply by |New|. |
67 | | template <typename T, typename... Args> |
68 | 2.54M | T *NewZeroed(Args &&...args) { |
69 | 2.54M | void *t = OPENSSL_zalloc(sizeof(T)); |
70 | 2.54M | if (t == nullptr) { |
71 | 0 | return nullptr; |
72 | 0 | } |
73 | 2.54M | return new (t) T(std::forward<Args>(args)...); |
74 | 2.54M | } bssl::EC_WRAPPED_SCALAR* bssl::NewZeroed<bssl::EC_WRAPPED_SCALAR>() Line | Count | Source | 68 | 3.42k | T *NewZeroed(Args &&...args) { | 69 | 3.42k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 3.42k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 3.42k | return new (t) T(std::forward<Args>(args)...); | 74 | 3.42k | } |
Unexecuted instantiation: bn_gencb_st* bssl::NewZeroed<bn_gencb_st>() bcm.cc:(anonymous namespace)::rand_thread_state* bssl::NewZeroed<(anonymous namespace)::rand_thread_state>() Line | Count | Source | 68 | 8 | T *NewZeroed(Args &&...args) { | 69 | 8 | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 8 | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 8 | return new (t) T(std::forward<Args>(args)...); | 74 | 8 | } |
bio_method_st* bssl::NewZeroed<bio_method_st>() Line | Count | Source | 68 | 6 | T *NewZeroed(Args &&...args) { | 69 | 6 | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 6 | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 6 | return new (t) T(std::forward<Args>(args)...); | 74 | 6 | } |
buf_mem_st* bssl::NewZeroed<buf_mem_st>() Line | Count | Source | 68 | 476k | T *NewZeroed(Args &&...args) { | 69 | 476k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 476k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 476k | return new (t) T(std::forward<Args>(args)...); | 74 | 476k | } |
Unexecuted instantiation: engine_st* bssl::NewZeroed<engine_st>() Unexecuted instantiation: p_dh.cc:(anonymous namespace)::dh_pkey_ctx_st* bssl::NewZeroed<(anonymous namespace)::dh_pkey_ctx_st>() EC_PKEY_CTX* bssl::NewZeroed<EC_PKEY_CTX>() Line | Count | Source | 68 | 23.7k | T *NewZeroed(Args &&...args) { | 69 | 23.7k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 23.7k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 23.7k | return new (t) T(std::forward<Args>(args)...); | 74 | 23.7k | } |
Unexecuted instantiation: HKDF_PKEY_CTX* bssl::NewZeroed<HKDF_PKEY_CTX>() bssl::lhash_st* bssl::NewZeroed<bssl::lhash_st>() Line | Count | Source | 68 | 25.8k | T *NewZeroed(Args &&...args) { | 69 | 25.8k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 25.8k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 25.8k | return new (t) T(std::forward<Args>(args)...); | 74 | 25.8k | } |
Unexecuted instantiation: crypto_buffer_pool_st* bssl::NewZeroed<crypto_buffer_pool_st>() bssl::CryptoBuffer* bssl::NewZeroed<bssl::CryptoBuffer>() Line | Count | Source | 68 | 315k | T *NewZeroed(Args &&...args) { | 69 | 315k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 315k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 315k | return new (t) T(std::forward<Args>(args)...); | 74 | 315k | } |
stack_st* bssl::NewZeroed<stack_st>() Line | Count | Source | 68 | 1.11M | T *NewZeroed(Args &&...args) { | 69 | 1.11M | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 1.11M | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 1.11M | return new (t) T(std::forward<Args>(args)...); | 74 | 1.11M | } |
Unexecuted instantiation: x509_lookup_st* bssl::NewZeroed<x509_lookup_st>() Unexecuted instantiation: x509_object_st* bssl::NewZeroed<x509_object_st>() x509_store_ctx_st* bssl::NewZeroed<x509_store_ctx_st>() Line | Count | Source | 68 | 7.28k | T *NewZeroed(Args &&...args) { | 69 | 7.28k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 7.28k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 7.28k | return new (t) T(std::forward<Args>(args)...); | 74 | 7.28k | } |
X509_VERIFY_PARAM_st* bssl::NewZeroed<X509_VERIFY_PARAM_st>() Line | Count | Source | 68 | 126k | T *NewZeroed(Args &&...args) { | 69 | 126k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 126k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 126k | return new (t) T(std::forward<Args>(args)...); | 74 | 126k | } |
bssl::X509Name* bssl::NewZeroed<bssl::X509Name>() Line | Count | Source | 68 | 13.2k | T *NewZeroed(Args &&...args) { | 69 | 13.2k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 13.2k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 13.2k | return new (t) T(std::forward<Args>(args)...); | 74 | 13.2k | } |
bssl::X509Impl* bssl::NewZeroed<bssl::X509Impl>() Line | Count | Source | 68 | 181k | T *NewZeroed(Args &&...args) { | 69 | 181k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 181k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 181k | return new (t) T(std::forward<Args>(args)...); | 74 | 181k | } |
Unexecuted instantiation: evp_encode_ctx_st* bssl::NewZeroed<evp_encode_ctx_st>() Unexecuted instantiation: DSA_SIG_st* bssl::NewZeroed<DSA_SIG_st>() Unexecuted instantiation: bssl::x509_policy_level_st* bssl::NewZeroed<bssl::x509_policy_level_st>() Unexecuted instantiation: bssl::x509_policy_node_st* bssl::NewZeroed<bssl::x509_policy_node_st>() conf_value_st* bssl::NewZeroed<conf_value_st>() Line | Count | Source | 68 | 252k | T *NewZeroed(Args &&...args) { | 69 | 252k | void *t = OPENSSL_zalloc(sizeof(T)); | 70 | 252k | if (t == nullptr) { | 71 | 0 | return nullptr; | 72 | 0 | } | 73 | 252k | return new (t) T(std::forward<Args>(args)...); | 74 | 252k | } |
Unexecuted instantiation: X509_info_st* bssl::NewZeroed<X509_info_st>() Unexecuted instantiation: private_key_st* bssl::NewZeroed<private_key_st>() Unexecuted instantiation: PKCS7* bssl::NewZeroed<PKCS7>() |
75 | | |
76 | | // Delete behaves like |delete| but uses |OPENSSL_free| to release memory. |
77 | | // |
78 | | // Note: unlike |delete| this does not support non-public destructors. |
79 | | template <typename T> |
80 | 8.77M | void Delete(T *t) { |
81 | 8.77M | if (t != nullptr) { |
82 | 8.34M | t->~T(); |
83 | 8.34M | OPENSSL_free(t); |
84 | 8.34M | } |
85 | 8.77M | } Unexecuted instantiation: void bssl::Delete<bssl::ECHConfig>(bssl::ECHConfig*) void bssl::Delete<bssl::ECHServerConfig>(bssl::ECHServerConfig*) Line | Count | Source | 80 | 12.8k | void Delete(T *t) { | 81 | 12.8k | if (t != nullptr) { | 82 | 12.8k | t->~T(); | 83 | 12.8k | OPENSSL_free(t); | 84 | 12.8k | } | 85 | 12.8k | } |
void bssl::Delete<bssl::SSLPAKEShare>(bssl::SSLPAKEShare*) Line | Count | Source | 80 | 16 | void Delete(T *t) { | 81 | 16 | if (t != nullptr) { | 82 | 16 | t->~T(); | 83 | 16 | OPENSSL_free(t); | 84 | 16 | } | 85 | 16 | } |
void bssl::Delete<bssl::SSLKeyShare>(bssl::SSLKeyShare*) Line | Count | Source | 80 | 128k | void Delete(T *t) { | 81 | 128k | if (t != nullptr) { | 82 | 128k | t->~T(); | 83 | 128k | OPENSSL_free(t); | 84 | 128k | } | 85 | 128k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Prover>(bssl::spake2plus::Prover*) void bssl::Delete<bssl::SSLCipherPreferenceList>(bssl::SSLCipherPreferenceList*) Line | Count | Source | 80 | 16.9k | void Delete(T *t) { | 81 | 16.9k | if (t != nullptr) { | 82 | 16.9k | t->~T(); | 83 | 16.9k | OPENSSL_free(t); | 84 | 16.9k | } | 85 | 16.9k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE>(bssl::SSL_HANDSHAKE*) Line | Count | Source | 80 | 140k | void Delete(T *t) { | 81 | 140k | if (t != nullptr) { | 82 | 140k | t->~T(); | 83 | 140k | OPENSSL_free(t); | 84 | 140k | } | 85 | 140k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE_HINTS>(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 80 | 74.7k | void Delete(T *t) { | 81 | 74.7k | if (t != nullptr) { | 82 | 74.7k | t->~T(); | 83 | 74.7k | OPENSSL_free(t); | 84 | 74.7k | } | 85 | 74.7k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Verifier>(bssl::spake2plus::Verifier*) void bssl::Delete<bssl::SSLAEADContext>(bssl::SSLAEADContext*) Line | Count | Source | 80 | 335k | void Delete(T *t) { | 81 | 335k | if (t != nullptr) { | 82 | 335k | t->~T(); | 83 | 335k | OPENSSL_free(t); | 84 | 335k | } | 85 | 335k | } |
void bssl::Delete<bssl::CERT>(bssl::CERT*) Line | Count | Source | 80 | 114k | void Delete(T *t) { | 81 | 114k | if (t != nullptr) { | 82 | 114k | t->~T(); | 83 | 114k | OPENSSL_free(t); | 84 | 114k | } | 85 | 114k | } |
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)::X25519Kyber768KeyShare>(bssl::(anonymous namespace)::X25519Kyber768KeyShare*) 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 | 80 | 109k | void Delete(T *t) { | 81 | 109k | if (t != nullptr) { | 82 | 109k | t->~T(); | 83 | 109k | OPENSSL_free(t); | 84 | 109k | } | 85 | 109k | } |
void bssl::Delete<ssl_st>(ssl_st*) Line | Count | Source | 80 | 109k | void Delete(T *t) { | 81 | 109k | if (t != nullptr) { | 82 | 109k | t->~T(); | 83 | 109k | OPENSSL_free(t); | 84 | 109k | } | 85 | 109k | } |
void bssl::Delete<bssl::TicketKey>(bssl::TicketKey*) Line | Count | Source | 80 | 399 | void Delete(T *t) { | 81 | 399 | if (t != nullptr) { | 82 | 399 | t->~T(); | 83 | 399 | OPENSSL_free(t); | 84 | 399 | } | 85 | 399 | } |
void bssl::Delete<bssl::RecordNumberEncrypter>(bssl::RecordNumberEncrypter*) Line | Count | Source | 80 | 41.3k | void Delete(T *t) { | 81 | 41.3k | if (t != nullptr) { | 82 | 41.3k | t->~T(); | 83 | 41.3k | OPENSSL_free(t); | 84 | 41.3k | } | 85 | 41.3k | } |
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 | 80 | 10.3k | void Delete(T *t) { | 81 | 10.3k | if (t != nullptr) { | 82 | 10.3k | t->~T(); | 83 | 10.3k | OPENSSL_free(t); | 84 | 10.3k | } | 85 | 10.3k | } |
void bssl::Delete<bssl::DTLSIncomingMessage>(bssl::DTLSIncomingMessage*) Line | Count | Source | 80 | 49.3k | void Delete(T *t) { | 81 | 49.3k | if (t != nullptr) { | 82 | 49.3k | t->~T(); | 83 | 49.3k | OPENSSL_free(t); | 84 | 49.3k | } | 85 | 49.3k | } |
void bssl::Delete<bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch*) Line | Count | Source | 80 | 7.76k | void Delete(T *t) { | 81 | 7.76k | if (t != nullptr) { | 82 | 7.76k | t->~T(); | 83 | 7.76k | OPENSSL_free(t); | 84 | 7.76k | } | 85 | 7.76k | } |
void bssl::Delete<bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch*) Line | Count | Source | 80 | 34.1k | void Delete(T *t) { | 81 | 34.1k | if (t != nullptr) { | 82 | 34.1k | t->~T(); | 83 | 34.1k | OPENSSL_free(t); | 84 | 34.1k | } | 85 | 34.1k | } |
void bssl::Delete<bssl::DTLSPrevReadEpoch>(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 80 | 31.8k | void Delete(T *t) { | 81 | 31.8k | if (t != nullptr) { | 82 | 31.8k | t->~T(); | 83 | 31.8k | OPENSSL_free(t); | 84 | 31.8k | } | 85 | 31.8k | } |
void bssl::Delete<bssl::DTLS1_STATE>(bssl::DTLS1_STATE*) Line | Count | Source | 80 | 38.8k | void Delete(T *t) { | 81 | 38.8k | if (t != nullptr) { | 82 | 38.8k | t->~T(); | 83 | 38.8k | OPENSSL_free(t); | 84 | 38.8k | } | 85 | 38.8k | } |
void bssl::Delete<bssl::SSL3_STATE>(bssl::SSL3_STATE*) Line | Count | Source | 80 | 109k | void Delete(T *t) { | 81 | 109k | if (t != nullptr) { | 82 | 109k | t->~T(); | 83 | 109k | OPENSSL_free(t); | 84 | 109k | } | 85 | 109k | } |
void bssl::Delete<ec_point_st>(ec_point_st*) Line | Count | Source | 80 | 128k | void Delete(T *t) { | 81 | 128k | if (t != nullptr) { | 82 | 128k | t->~T(); | 83 | 128k | OPENSSL_free(t); | 84 | 128k | } | 85 | 128k | } |
void bssl::Delete<bssl::EC_WRAPPED_SCALAR>(bssl::EC_WRAPPED_SCALAR*) Line | Count | Source | 80 | 52.5k | void Delete(T *t) { | 81 | 52.5k | if (t != nullptr) { | 82 | 3.40k | t->~T(); | 83 | 3.40k | OPENSSL_free(t); | 84 | 3.40k | } | 85 | 52.5k | } |
Unexecuted instantiation: 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*) 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*) Unexecuted instantiation: bcm.cc:void bssl::Delete<(anonymous namespace)::rand_thread_state>((anonymous namespace)::rand_thread_state*) void bssl::Delete<bignum_st>(bignum_st*) Line | Count | Source | 80 | 647k | void Delete(T *t) { | 81 | 647k | if (t != nullptr) { | 82 | 647k | t->~T(); | 83 | 647k | OPENSSL_free(t); | 84 | 647k | } | 85 | 647k | } |
void bssl::Delete<bssl::BignumCtx>(bssl::BignumCtx*) Line | Count | Source | 80 | 74.7k | void Delete(T *t) { | 81 | 74.7k | if (t != nullptr) { | 82 | 74.7k | t->~T(); | 83 | 74.7k | OPENSSL_free(t); | 84 | 74.7k | } | 85 | 74.7k | } |
void bssl::Delete<bn_mont_ctx_st>(bn_mont_ctx_st*) Line | Count | Source | 80 | 22.0k | void Delete(T *t) { | 81 | 22.0k | if (t != nullptr) { | 82 | 22.0k | t->~T(); | 83 | 22.0k | OPENSSL_free(t); | 84 | 22.0k | } | 85 | 22.0k | } |
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 | 80 | 33.0k | void Delete(T *t) { | 81 | 33.0k | if (t != nullptr) { | 82 | 33.0k | t->~T(); | 83 | 33.0k | OPENSSL_free(t); | 84 | 33.0k | } | 85 | 33.0k | } |
Unexecuted instantiation: 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*) 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*) Unexecuted instantiation: 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*) 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: void bssl::Delete<bio_method_st>(bio_method_st*) void bssl::Delete<buf_mem_st>(buf_mem_st*) Line | Count | Source | 80 | 434k | void Delete(T *t) { | 81 | 434k | if (t != nullptr) { | 82 | 434k | t->~T(); | 83 | 434k | OPENSSL_free(t); | 84 | 434k | } | 85 | 434k | } |
void bssl::Delete<ecdsa_sig_st>(ecdsa_sig_st*) Line | Count | Source | 80 | 13.8k | void Delete(T *t) { | 81 | 13.8k | if (t != nullptr) { | 82 | 13.8k | t->~T(); | 83 | 13.8k | OPENSSL_free(t); | 84 | 13.8k | } | 85 | 13.8k | } |
Unexecuted instantiation: void bssl::Delete<engine_st>(engine_st*) void bssl::Delete<bssl::EvpPkeyCtx>(bssl::EvpPkeyCtx*) Line | Count | Source | 80 | 111k | void Delete(T *t) { | 81 | 111k | if (t != nullptr) { | 82 | 111k | t->~T(); | 83 | 111k | OPENSSL_free(t); | 84 | 111k | } | 85 | 111k | } |
Unexecuted instantiation: p_dh.cc:void bssl::Delete<(anonymous namespace)::dh_pkey_ctx_st>((anonymous namespace)::dh_pkey_ctx_st*) void bssl::Delete<EC_PKEY_CTX>(EC_PKEY_CTX*) Line | Count | Source | 80 | 23.7k | void Delete(T *t) { | 81 | 23.7k | if (t != nullptr) { | 82 | 23.7k | t->~T(); | 83 | 23.7k | OPENSSL_free(t); | 84 | 23.7k | } | 85 | 23.7k | } |
p_ed25519.cc:void bssl::Delete<(anonymous namespace)::ED25519_KEY>((anonymous namespace)::ED25519_KEY*) Line | Count | Source | 80 | 302 | void Delete(T *t) { | 81 | 302 | if (t != nullptr) { | 82 | 302 | t->~T(); | 83 | 302 | OPENSSL_free(t); | 84 | 302 | } | 85 | 302 | } |
Unexecuted instantiation: void bssl::Delete<HKDF_PKEY_CTX>(HKDF_PKEY_CTX*) 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)::MLDSA44Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 80 | 4 | void Delete(T *t) { | 81 | 4 | if (t != nullptr) { | 82 | 4 | t->~T(); | 83 | 4 | OPENSSL_free(t); | 84 | 4 | } | 85 | 4 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 80 | 2 | void Delete(T *t) { | 81 | 2 | if (t != nullptr) { | 82 | 2 | t->~T(); | 83 | 2 | OPENSSL_free(t); | 84 | 2 | } | 85 | 2 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 80 | 6 | void Delete(T *t) { | 81 | 6 | if (t != nullptr) { | 82 | 6 | t->~T(); | 83 | 6 | OPENSSL_free(t); | 84 | 6 | } | 85 | 6 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 80 | 3 | void Delete(T *t) { | 81 | 3 | if (t != nullptr) { | 82 | 3 | t->~T(); | 83 | 3 | OPENSSL_free(t); | 84 | 3 | } | 85 | 3 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 80 | 6 | void Delete(T *t) { | 81 | 6 | if (t != nullptr) { | 82 | 6 | t->~T(); | 83 | 6 | OPENSSL_free(t); | 84 | 6 | } | 85 | 6 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 80 | 2 | void Delete(T *t) { | 81 | 2 | if (t != nullptr) { | 82 | 2 | t->~T(); | 83 | 2 | OPENSSL_free(t); | 84 | 2 | } | 85 | 2 | } |
p_rsa.cc:void bssl::Delete<(anonymous namespace)::RSA_PKEY_CTX>((anonymous namespace)::RSA_PKEY_CTX*) Line | Count | Source | 80 | 87.8k | void Delete(T *t) { | 81 | 87.8k | if (t != nullptr) { | 82 | 87.8k | t->~T(); | 83 | 87.8k | OPENSSL_free(t); | 84 | 87.8k | } | 85 | 87.8k | } |
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_st>(bssl::lhash_st*) Line | Count | Source | 80 | 25.8k | void Delete(T *t) { | 81 | 25.8k | if (t != nullptr) { | 82 | 25.8k | t->~T(); | 83 | 25.8k | OPENSSL_free(t); | 84 | 25.8k | } | 85 | 25.8k | } |
void bssl::Delete<bssl::lhash_item_st>(bssl::lhash_item_st*) Line | Count | Source | 80 | 55.4k | void Delete(T *t) { | 81 | 55.4k | if (t != nullptr) { | 82 | 55.4k | t->~T(); | 83 | 55.4k | OPENSSL_free(t); | 84 | 55.4k | } | 85 | 55.4k | } |
Unexecuted instantiation: void bssl::Delete<crypto_buffer_pool_st>(crypto_buffer_pool_st*) void bssl::Delete<bssl::CryptoBuffer>(bssl::CryptoBuffer*) Line | Count | Source | 80 | 315k | void Delete(T *t) { | 81 | 315k | if (t != nullptr) { | 82 | 315k | t->~T(); | 83 | 315k | OPENSSL_free(t); | 84 | 315k | } | 85 | 315k | } |
void bssl::Delete<stack_st>(stack_st*) Line | Count | Source | 80 | 1.11M | void Delete(T *t) { | 81 | 1.11M | if (t != nullptr) { | 82 | 1.11M | t->~T(); | 83 | 1.11M | OPENSSL_free(t); | 84 | 1.11M | } | 85 | 1.11M | } |
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 | 80 | 7.28k | void Delete(T *t) { | 81 | 7.28k | if (t != nullptr) { | 82 | 7.28k | t->~T(); | 83 | 7.28k | OPENSSL_free(t); | 84 | 7.28k | } | 85 | 7.28k | } |
void bssl::Delete<X509_VERIFY_PARAM_st>(X509_VERIFY_PARAM_st*) Line | Count | Source | 80 | 126k | void Delete(T *t) { | 81 | 126k | if (t != nullptr) { | 82 | 126k | t->~T(); | 83 | 126k | OPENSSL_free(t); | 84 | 126k | } | 85 | 126k | } |
void bssl::Delete<X509_name_entry_st>(X509_name_entry_st*) Line | Count | Source | 80 | 698k | void Delete(T *t) { | 81 | 698k | if (t != nullptr) { | 82 | 698k | t->~T(); | 83 | 698k | OPENSSL_free(t); | 84 | 698k | } | 85 | 698k | } |
void bssl::Delete<bssl::X509_NAME_CACHE>(bssl::X509_NAME_CACHE*) Line | Count | Source | 80 | 699k | void Delete(T *t) { | 81 | 699k | if (t != nullptr) { | 82 | 314k | t->~T(); | 83 | 314k | OPENSSL_free(t); | 84 | 314k | } | 85 | 699k | } |
void bssl::Delete<bssl::X509Name>(bssl::X509Name*) Line | Count | Source | 80 | 13.2k | void Delete(T *t) { | 81 | 13.2k | if (t != nullptr) { | 82 | 13.2k | t->~T(); | 83 | 13.2k | OPENSSL_free(t); | 84 | 13.2k | } | 85 | 13.2k | } |
void bssl::Delete<asn1_object_st>(asn1_object_st*) Line | Count | Source | 80 | 1.67M | void Delete(T *t) { | 81 | 1.67M | if (t != nullptr) { | 82 | 1.67M | t->~T(); | 83 | 1.67M | OPENSSL_free(t); | 84 | 1.67M | } | 85 | 1.67M | } |
Unexecuted instantiation: void bssl::Delete<bssl::ASN1_STRING_TABLE>(bssl::ASN1_STRING_TABLE*) void bssl::Delete<asn1_string_st>(asn1_string_st*) Line | Count | Source | 80 | 977k | void Delete(T *t) { | 81 | 977k | if (t != nullptr) { | 82 | 977k | t->~T(); | 83 | 977k | OPENSSL_free(t); | 84 | 977k | } | 85 | 977k | } |
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: void bssl::Delete<pkcs12_st>(pkcs12_st*) void bssl::Delete<char>(char*) Line | Count | Source | 80 | 10.5k | void Delete(T *t) { | 81 | 10.5k | if (t != nullptr) { | 82 | 10.5k | t->~T(); | 83 | 10.5k | OPENSSL_free(t); | 84 | 10.5k | } | 85 | 10.5k | } |
Unexecuted instantiation: void bssl::Delete<bssl::lookup_dir_hashes_st>(bssl::lookup_dir_hashes_st*) Unexecuted instantiation: void bssl::Delete<bssl::lookup_dir_entry_st>(bssl::lookup_dir_entry_st*) Unexecuted instantiation: void bssl::Delete<bssl::lookup_dir_st>(bssl::lookup_dir_st*) Unexecuted instantiation: void bssl::Delete<bssl::x509_policy_node_st>(bssl::x509_policy_node_st*) Unexecuted instantiation: void bssl::Delete<bssl::x509_policy_level_st>(bssl::x509_policy_level_st*) void bssl::Delete<bssl::conf_section_st>(bssl::conf_section_st*) Line | Count | Source | 80 | 18.5k | void Delete(T *t) { | 81 | 18.5k | if (t != nullptr) { | 82 | 18.5k | t->~T(); | 83 | 18.5k | OPENSSL_free(t); | 84 | 18.5k | } | 85 | 18.5k | } |
void bssl::Delete<conf_value_st>(conf_value_st*) Line | Count | Source | 80 | 30.3k | void Delete(T *t) { | 81 | 30.3k | if (t != nullptr) { | 82 | 30.3k | t->~T(); | 83 | 30.3k | OPENSSL_free(t); | 84 | 30.3k | } | 85 | 30.3k | } |
void bssl::Delete<conf_st>(conf_st*) Line | Count | Source | 80 | 10.5k | void Delete(T *t) { | 81 | 10.5k | if (t != nullptr) { | 82 | 10.5k | t->~T(); | 83 | 10.5k | OPENSSL_free(t); | 84 | 10.5k | } | 85 | 10.5k | } |
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*) |
86 | | |
87 | | namespace internal { |
88 | | |
89 | | // All types with kAllowUniquePtr set may be used with UniquePtr. Other types |
90 | | // may be C structs which require a |BORINGSSL_MAKE_DELETER| registration. |
91 | | template <typename T> |
92 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowUniquePtr>> { |
93 | 1.10M | 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 | 93 | 12.8k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLPAKEShare, void>::Free(bssl::SSLPAKEShare*) Line | Count | Source | 93 | 16 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLKeyShare, void>::Free(bssl::SSLKeyShare*) Line | Count | Source | 93 | 128k | 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 | 93 | 16.9k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE, void>::Free(bssl::SSL_HANDSHAKE*) Line | Count | Source | 93 | 140k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE_HINTS, void>::Free(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 93 | 74.7k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::spake2plus::Verifier, void>::Free(bssl::spake2plus::Verifier*) bssl::internal::DeleterImpl<bssl::SSLAEADContext, void>::Free(bssl::SSLAEADContext*) Line | Count | Source | 93 | 335k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::CERT, void>::Free(bssl::CERT*) Line | Count | Source | 93 | 114k | 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)::X25519Kyber768KeyShare, void>::Free(bssl::(anonymous namespace)::X25519Kyber768KeyShare*) 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 | 93 | 109k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::TicketKey, void>::Free(bssl::TicketKey*) Line | Count | Source | 93 | 399 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::RecordNumberEncrypter, void>::Free(bssl::RecordNumberEncrypter*) Line | Count | Source | 93 | 41.3k | 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 | 93 | 10.3k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSIncomingMessage, void>::Free(bssl::DTLSIncomingMessage*) Line | Count | Source | 93 | 49.3k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSWriteEpoch, void>::Free(bssl::DTLSWriteEpoch*) Line | Count | Source | 93 | 7.76k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSReadEpoch, void>::Free(bssl::DTLSReadEpoch*) Line | Count | Source | 93 | 34.1k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSPrevReadEpoch, void>::Free(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 93 | 31.8k | 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*) Unexecuted instantiation: 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*) 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*) Unexecuted instantiation: 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*) 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*) Unexecuted instantiation: 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*) 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 | 93 | 4 | 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 | 93 | 2 | 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 | 93 | 6 | 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 | 93 | 3 | 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 | 93 | 6 | 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 | 93 | 2 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509_NAME_CACHE, void>::Free(bssl::X509_NAME_CACHE*) |
94 | | }; |
95 | | |
96 | | // All types with kAllowRefCountedUniquePtr may be used with UniquePtr, which |
97 | | // then will behave like std::shared_ptr. |
98 | | template <typename T> |
99 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowRefCountedUniquePtr>> { |
100 | 223k | 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 | 100 | 2.57k | 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 | 100 | 201k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::DSAImpl, void>::Free(bssl::DSAImpl*) Line | Count | Source | 100 | 5.94k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509Store, void>::Free(bssl::X509Store*) bssl::internal::DeleterImpl<bssl::X509Impl, void>::Free(bssl::X509Impl*) Line | Count | Source | 100 | 13.2k | static void Free(T *t) { t->DecRefInternal(); } |
|
101 | | }; |
102 | | |
103 | | } // namespace internal |
104 | | |
105 | | // All types with kAllowRefCountedUniquePtr types also automatically get an |
106 | | // UpRef function. Other types may be C structs which require a |
107 | | // |BORINGSSL_MAKE_UP_REF| registration. |
108 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
109 | 167k | inline UniquePtr<T> UpRef(T *v) { |
110 | 167k | if (v != nullptr) { |
111 | 111k | v->UpRefInternal(); |
112 | 111k | } |
113 | 167k | return UniquePtr<T>(v); |
114 | 167k | } |
115 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
116 | 111k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { |
117 | 111k | return UpRef(ptr.get()); |
118 | 111k | } |
119 | | |
120 | | // MakeUnique behaves like |std::make_unique| but returns nullptr on allocation |
121 | | // error. |
122 | | template <typename T, typename... Args> |
123 | 2.93M | UniquePtr<T> MakeUnique(Args &&...args) { |
124 | 2.93M | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); |
125 | 2.93M | } 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 | 123 | 12.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 12.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 12.8k | } |
std::__1::unique_ptr<bssl::SSLPAKEShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLPAKEShare>() Line | Count | Source | 123 | 16 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 16 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 16 | } |
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 | 123 | 16.9k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 16.9k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 16.9k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE_HINTS, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 123 | 74.7k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 74.7k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 74.7k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE, ssl_st*&>(ssl_st*&) Line | Count | Source | 123 | 140k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 140k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 140k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 123 | 218k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 218k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 218k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 123 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 117k | } |
std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_credential_st, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 123 | 114k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 114k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 114k | } |
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 | 123 | 109k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 109k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 109k | } |
Unexecuted instantiation: std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_credential_st, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_credential_st, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 123 | 109k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 109k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 109k | } |
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 | 123 | 17.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 17.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 17.4k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 123 | 66.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 66.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 66.1k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519Kyber768KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519Kyber768KeyShare>() Line | Count | Source | 123 | 241 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 241 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 241 | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519MLKEM768KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 123 | 44.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 44.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 44.3k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::MLKEM1024KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 123 | 12 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 12 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 12 | } |
std::__1::unique_ptr<ssl_ctx_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_ctx_st, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 123 | 4.85k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 4.85k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 4.85k | } |
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 | 123 | 4.85k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 4.85k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 4.85k | } |
std::__1::unique_ptr<ssl_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_st, ssl_ctx_st*&>(ssl_ctx_st*&) Line | Count | Source | 123 | 109k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 109k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 109k | } |
std::__1::unique_ptr<bssl::SSL_CONFIG, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_CONFIG, ssl_st*>(ssl_st*&&) Line | Count | Source | 123 | 109k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 109k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 109k | } |
std::__1::unique_ptr<bssl::TicketKey, bssl::internal::Deleter> bssl::MakeUnique<bssl::TicketKey>() Line | Count | Source | 123 | 402 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 402 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 402 | } |
std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_session_st, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 123 | 215k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 215k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 215k | } |
tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::NullRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 123 | 41.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 41.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 41.3k | } |
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>() std::__1::unique_ptr<bssl::DTLSIncomingMessage, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSIncomingMessage>() Line | Count | Source | 123 | 49.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 49.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 49.3k | } |
std::__1::unique_ptr<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, bssl::internal::Deleter> bssl::MakeUnique<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 123 | 10.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 10.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 10.3k | } |
std::__1::unique_ptr<bssl::DTLS1_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLS1_STATE>() Line | Count | Source | 123 | 38.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 38.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 38.8k | } |
std::__1::unique_ptr<bssl::DTLSPrevReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 123 | 31.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 31.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 31.8k | } |
std::__1::unique_ptr<bssl::SSL3_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL3_STATE>() Line | Count | Source | 123 | 109k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 109k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 109k | } |
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>() Unexecuted instantiation: 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>() 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>() Unexecuted instantiation: 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>() 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>() Unexecuted instantiation: 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>() 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 | 123 | 111k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 111k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 111k | } |
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 | 123 | 4 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 4 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 4 | } |
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 | 123 | 2 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 2 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 2 | } |
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 | 123 | 6 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 6 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 6 | } |
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 | 123 | 3 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 3 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 3 | } |
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 | 123 | 6 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 6 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 6 | } |
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 | 123 | 2 | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 2 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 2 | } |
Unexecuted instantiation: std::__1::unique_ptr<X509_algor_st, bssl::internal::Deleter> bssl::MakeUnique<X509_algor_st>() std::__1::unique_ptr<X509_name_entry_st, bssl::internal::Deleter> bssl::MakeUnique<X509_name_entry_st>() Line | Count | Source | 123 | 698k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 698k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 698k | } |
std::__1::unique_ptr<bssl::X509_NAME_CACHE, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509_NAME_CACHE>() Line | Count | Source | 123 | 314k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 314k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 314k | } |
Unexecuted instantiation: std::__1::unique_ptr<X509_pubkey_st, bssl::internal::Deleter> bssl::MakeUnique<X509_pubkey_st>() std::__1::unique_ptr<bssl::DTLSReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 123 | 34.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 34.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 34.1k | } |
std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 123 | 7.76k | UniquePtr<T> MakeUnique(Args &&...args) { | 124 | 7.76k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 125 | 7.76k | } |
|
126 | | |
127 | | |
128 | | // RefCounted is a common base for ref-counted types. This is an instance of the |
129 | | // C++ curiously-recurring template pattern, so a type Foo must subclass |
130 | | // RefCounted<Foo>. It additionally must friend RefCounted<Foo> to allow calling |
131 | | // the destructor. |
132 | | template <typename Derived> |
133 | | class RefCounted { |
134 | | public: |
135 | | static constexpr bool kAllowRefCountedUniquePtr = true; |
136 | | |
137 | | RefCounted(const RefCounted &) = delete; |
138 | | RefCounted &operator=(const RefCounted &) = delete; |
139 | | |
140 | | // These methods are intentionally named differently from `bssl::UpRef` to |
141 | | // avoid a collision. Only the implementations of `FOO_up_ref` and `FOO_free` |
142 | | // should call these. |
143 | 982k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); }bssl::RefCounted<ssl_ech_keys_st>::UpRefInternal() Line | Count | Source | 143 | 413 | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
bssl::RefCounted<ssl_credential_st>::UpRefInternal() Line | Count | Source | 143 | 23.6k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
bssl::RefCounted<ssl_ctx_st>::UpRefInternal() Line | Count | Source | 143 | 218k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
bssl::RefCounted<ssl_session_st>::UpRefInternal() Line | Count | Source | 143 | 109k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::UpRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::UpRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::UpRefInternal() bssl::RefCounted<bssl::RSAImpl>::UpRefInternal() Line | Count | Source | 143 | 12 | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
bssl::RefCounted<bssl::Bio>::UpRefInternal() Line | Count | Source | 143 | 14 | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
bssl::RefCounted<bssl::EvpPkey>::UpRefInternal() Line | Count | Source | 143 | 438k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
Unexecuted instantiation: bssl::RefCounted<bssl::X509Store>::UpRefInternal() bssl::RefCounted<bssl::X509Impl>::UpRefInternal() Line | Count | Source | 143 | 192k | void UpRefInternal() { CRYPTO_refcount_inc(&references_); } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::UpRefInternal() |
144 | 2.08M | void DecRefInternal() { |
145 | 2.08M | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { |
146 | 1.10M | Derived *d = static_cast<Derived *>(this); |
147 | 1.10M | d->~Derived(); |
148 | 1.10M | OPENSSL_free(d); |
149 | 1.10M | } |
150 | 2.08M | } bssl::RefCounted<ssl_ech_keys_st>::DecRefInternal() Line | Count | Source | 144 | 15.3k | void DecRefInternal() { | 145 | 15.3k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 14.9k | Derived *d = static_cast<Derived *>(this); | 147 | 14.9k | d->~Derived(); | 148 | 14.9k | OPENSSL_free(d); | 149 | 14.9k | } | 150 | 15.3k | } |
bssl::RefCounted<ssl_credential_st>::DecRefInternal() Line | Count | Source | 144 | 246k | void DecRefInternal() { | 145 | 246k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 223k | Derived *d = static_cast<Derived *>(this); | 147 | 223k | d->~Derived(); | 148 | 223k | OPENSSL_free(d); | 149 | 223k | } | 150 | 246k | } |
bssl::RefCounted<ssl_ctx_st>::DecRefInternal() Line | Count | Source | 144 | 223k | void DecRefInternal() { | 145 | 223k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 4.84k | Derived *d = static_cast<Derived *>(this); | 147 | 4.84k | d->~Derived(); | 148 | 4.84k | OPENSSL_free(d); | 149 | 4.84k | } | 150 | 223k | } |
bssl::RefCounted<ssl_session_st>::DecRefInternal() Line | Count | Source | 144 | 325k | void DecRefInternal() { | 145 | 325k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 215k | Derived *d = static_cast<Derived *>(this); | 147 | 215k | d->~Derived(); | 148 | 215k | OPENSSL_free(d); | 149 | 215k | } | 150 | 325k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::DecRefInternal() bssl::RefCounted<bssl::ECKey>::DecRefInternal() Line | Count | Source | 144 | 49.0k | void DecRefInternal() { | 145 | 49.0k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 49.0k | Derived *d = static_cast<Derived *>(this); | 147 | 49.0k | d->~Derived(); | 148 | 49.0k | OPENSSL_free(d); | 149 | 49.0k | } | 150 | 49.0k | } |
bssl::RefCounted<bssl::RSAImpl>::DecRefInternal() Line | Count | Source | 144 | 114k | void DecRefInternal() { | 145 | 114k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 114k | Derived *d = static_cast<Derived *>(this); | 147 | 114k | d->~Derived(); | 148 | 114k | OPENSSL_free(d); | 149 | 114k | } | 150 | 114k | } |
bssl::RefCounted<bssl::Bio>::DecRefInternal() Line | Count | Source | 144 | 71.7k | void DecRefInternal() { | 145 | 71.7k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 71.7k | Derived *d = static_cast<Derived *>(this); | 147 | 71.7k | d->~Derived(); | 148 | 71.7k | OPENSSL_free(d); | 149 | 71.7k | } | 150 | 71.7k | } |
bssl::RefCounted<bssl::EvpPkey>::DecRefInternal() Line | Count | Source | 144 | 653k | void DecRefInternal() { | 145 | 653k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 214k | Derived *d = static_cast<Derived *>(this); | 147 | 214k | d->~Derived(); | 148 | 214k | OPENSSL_free(d); | 149 | 214k | } | 150 | 653k | } |
bssl::RefCounted<bssl::DSAImpl>::DecRefInternal() Line | Count | Source | 144 | 6.81k | void DecRefInternal() { | 145 | 6.81k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 6.81k | Derived *d = static_cast<Derived *>(this); | 147 | 6.81k | d->~Derived(); | 148 | 6.81k | OPENSSL_free(d); | 149 | 6.81k | } | 150 | 6.81k | } |
bssl::RefCounted<bssl::X509Store>::DecRefInternal() Line | Count | Source | 144 | 4.84k | void DecRefInternal() { | 145 | 4.84k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 4.84k | Derived *d = static_cast<Derived *>(this); | 147 | 4.84k | d->~Derived(); | 148 | 4.84k | OPENSSL_free(d); | 149 | 4.84k | } | 150 | 4.84k | } |
bssl::RefCounted<bssl::X509Impl>::DecRefInternal() Line | Count | Source | 144 | 373k | void DecRefInternal() { | 145 | 373k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 146 | 181k | Derived *d = static_cast<Derived *>(this); | 147 | 181k | d->~Derived(); | 148 | 181k | OPENSSL_free(d); | 149 | 181k | } | 150 | 373k | } |
|
151 | | |
152 | | protected: |
153 | | // Ensure that only `Derived`, which must inherit from `RefCounted<Derived>`, |
154 | | // can call the constructor. This catches bugs where someone inherited from |
155 | | // the wrong base. |
156 | | class CheckSubClass { |
157 | | private: |
158 | | friend Derived; |
159 | | CheckSubClass() = default; |
160 | | }; |
161 | 1.10M | RefCounted(CheckSubClass) { |
162 | 1.10M | static_assert(std::is_base_of_v<RefCounted, Derived>, |
163 | 1.10M | "Derived must subclass RefCounted<Derived>"); |
164 | 1.10M | } bssl::RefCounted<ssl_ech_keys_st>::RefCounted(bssl::RefCounted<ssl_ech_keys_st>::CheckSubClass) Line | Count | Source | 161 | 14.9k | RefCounted(CheckSubClass) { | 162 | 14.9k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 14.9k | "Derived must subclass RefCounted<Derived>"); | 164 | 14.9k | } |
bssl::RefCounted<ssl_credential_st>::RefCounted(bssl::RefCounted<ssl_credential_st>::CheckSubClass) Line | Count | Source | 161 | 223k | RefCounted(CheckSubClass) { | 162 | 223k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 223k | "Derived must subclass RefCounted<Derived>"); | 164 | 223k | } |
bssl::RefCounted<ssl_ctx_st>::RefCounted(bssl::RefCounted<ssl_ctx_st>::CheckSubClass) Line | Count | Source | 161 | 4.85k | RefCounted(CheckSubClass) { | 162 | 4.85k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 4.85k | "Derived must subclass RefCounted<Derived>"); | 164 | 4.85k | } |
bssl::RefCounted<ssl_session_st>::RefCounted(bssl::RefCounted<ssl_session_st>::CheckSubClass) Line | Count | Source | 161 | 215k | RefCounted(CheckSubClass) { | 162 | 215k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 215k | "Derived must subclass RefCounted<Derived>"); | 164 | 215k | } |
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 | 161 | 49.1k | RefCounted(CheckSubClass) { | 162 | 49.1k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 49.1k | "Derived must subclass RefCounted<Derived>"); | 164 | 49.1k | } |
bssl::RefCounted<bssl::RSAImpl>::RefCounted(bssl::RefCounted<bssl::RSAImpl>::CheckSubClass) Line | Count | Source | 161 | 114k | RefCounted(CheckSubClass) { | 162 | 114k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 114k | "Derived must subclass RefCounted<Derived>"); | 164 | 114k | } |
bssl::RefCounted<bssl::Bio>::RefCounted(bssl::RefCounted<bssl::Bio>::CheckSubClass) Line | Count | Source | 161 | 71.7k | RefCounted(CheckSubClass) { | 162 | 71.7k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 71.7k | "Derived must subclass RefCounted<Derived>"); | 164 | 71.7k | } |
bssl::RefCounted<bssl::EvpPkey>::RefCounted(bssl::RefCounted<bssl::EvpPkey>::CheckSubClass) Line | Count | Source | 161 | 214k | RefCounted(CheckSubClass) { | 162 | 214k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 214k | "Derived must subclass RefCounted<Derived>"); | 164 | 214k | } |
bssl::RefCounted<bssl::X509Store>::RefCounted(bssl::RefCounted<bssl::X509Store>::CheckSubClass) Line | Count | Source | 161 | 4.85k | RefCounted(CheckSubClass) { | 162 | 4.85k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 4.85k | "Derived must subclass RefCounted<Derived>"); | 164 | 4.85k | } |
bssl::RefCounted<bssl::X509Impl>::RefCounted(bssl::RefCounted<bssl::X509Impl>::CheckSubClass) Line | Count | Source | 161 | 181k | RefCounted(CheckSubClass) { | 162 | 181k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 181k | "Derived must subclass RefCounted<Derived>"); | 164 | 181k | } |
bssl::RefCounted<bssl::DSAImpl>::RefCounted(bssl::RefCounted<bssl::DSAImpl>::CheckSubClass) Line | Count | Source | 161 | 6.81k | RefCounted(CheckSubClass) { | 162 | 6.81k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 163 | 6.81k | "Derived must subclass RefCounted<Derived>"); | 164 | 6.81k | } |
|
165 | | |
166 | 1.10M | ~RefCounted() { BSSL_CHECK(references_.load() == 0); }bssl::RefCounted<ssl_ech_keys_st>::~RefCounted() Line | Count | Source | 166 | 14.9k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<ssl_credential_st>::~RefCounted() Line | Count | Source | 166 | 223k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<ssl_ctx_st>::~RefCounted() Line | Count | Source | 166 | 4.84k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<ssl_session_st>::~RefCounted() Line | Count | Source | 166 | 215k | ~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 | 166 | 49.0k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::RSAImpl>::~RefCounted() Line | Count | Source | 166 | 114k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::Bio>::~RefCounted() Line | Count | Source | 166 | 71.7k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::EvpPkey>::~RefCounted() Line | Count | Source | 166 | 214k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::X509Store>::~RefCounted() Line | Count | Source | 166 | 4.84k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::X509Impl>::~RefCounted() Line | Count | Source | 166 | 181k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::DSAImpl>::~RefCounted() Line | Count | Source | 166 | 6.81k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
|
167 | | |
168 | | private: |
169 | | CRYPTO_refcount_t references_ = 1; |
170 | | }; |
171 | | |
172 | | |
173 | | // Containers. |
174 | | |
175 | | // Array<T> is an owning array of elements of |T|. |
176 | | template <typename T> |
177 | | class Array { |
178 | | public: |
179 | | using value_type = std::remove_cv_t<T>; |
180 | | |
181 | | // Array's default constructor creates an empty array. |
182 | 8.89M | Array() {}bssl::Array<unsigned char>::Array() Line | Count | Source | 182 | 7.58M | Array() {} |
bssl::Array<unsigned short>::Array() Line | Count | Source | 182 | 1.13M | Array() {} |
Unexecuted instantiation: bssl::Array<unsigned long>::Array() bssl::Array<unsigned int>::Array() Line | Count | Source | 182 | 114k | Array() {} |
bssl::Array<ssl_credential_st*>::Array() Line | Count | Source | 182 | 24.0k | Array() {} |
bssl::Array<int>::Array() Line | Count | Source | 182 | 4.90k | Array() {} |
bssl::Array<bool>::Array() Line | Count | Source | 182 | 33.8k | Array() {} |
|
183 | | Array(const Array &) = delete; |
184 | 337k | Array(Array &&other) { *this = std::move(other); } |
185 | | |
186 | 9.23M | ~Array() { Reset(); }bssl::Array<unsigned char>::~Array() Line | Count | Source | 186 | 7.91M | ~Array() { Reset(); } |
bssl::Array<unsigned short>::~Array() Line | Count | Source | 186 | 1.13M | ~Array() { Reset(); } |
bssl::Array<unsigned int>::~Array() Line | Count | Source | 186 | 114k | ~Array() { Reset(); } |
Unexecuted instantiation: bssl::Array<unsigned long>::~Array() bssl::Array<ssl_credential_st*>::~Array() Line | Count | Source | 186 | 24.0k | ~Array() { Reset(); } |
bssl::Array<int>::~Array() Line | Count | Source | 186 | 4.90k | ~Array() { Reset(); } |
bssl::Array<bool>::~Array() Line | Count | Source | 186 | 33.8k | ~Array() { Reset(); } |
|
187 | | |
188 | | Array &operator=(const Array &) = delete; |
189 | 440k | Array &operator=(Array &&other) { |
190 | 440k | Reset(); |
191 | 440k | other.Release(&data_, &size_); |
192 | 440k | return *this; |
193 | 440k | } bssl::Array<unsigned char>::operator=(bssl::Array<unsigned char>&&) Line | Count | Source | 189 | 406k | Array &operator=(Array &&other) { | 190 | 406k | Reset(); | 191 | 406k | other.Release(&data_, &size_); | 192 | 406k | return *this; | 193 | 406k | } |
bssl::Array<unsigned short>::operator=(bssl::Array<unsigned short>&&) Line | Count | Source | 189 | 34.2k | Array &operator=(Array &&other) { | 190 | 34.2k | Reset(); | 191 | 34.2k | other.Release(&data_, &size_); | 192 | 34.2k | return *this; | 193 | 34.2k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::operator=(bssl::Array<unsigned int>&&) |
194 | | |
195 | 1.94M | const T *data() const { return data_; }bssl::Array<unsigned char>::data() const Line | Count | Source | 195 | 1.39M | const T *data() const { return data_; } |
bssl::Array<unsigned short>::data() const Line | Count | Source | 195 | 422k | const T *data() const { return data_; } |
bssl::Array<unsigned int>::data() const Line | Count | Source | 195 | 109k | const T *data() const { return data_; } |
bssl::Array<bool>::data() const Line | Count | Source | 195 | 16.9k | const T *data() const { return data_; } |
|
196 | 327k | T *data() { return data_; }bssl::Array<unsigned char>::data() Line | Count | Source | 196 | 323k | T *data() { return data_; } |
bssl::Array<unsigned short>::data() Line | Count | Source | 196 | 4.00k | T *data() { return data_; } |
|
197 | 6.72M | size_t size() const { return size_; }bssl::Array<unsigned char>::size() const Line | Count | Source | 197 | 5.16M | size_t size() const { return size_; } |
bssl::Array<unsigned short>::size() const Line | Count | Source | 197 | 1.43M | size_t size() const { return size_; } |
bssl::Array<unsigned int>::size() const Line | Count | Source | 197 | 109k | size_t size() const { return size_; } |
bssl::Array<bool>::size() const Line | Count | Source | 197 | 16.9k | size_t size() const { return size_; } |
|
198 | 2.40M | bool empty() const { return size_ == 0; }bssl::Array<unsigned char>::empty() const Line | Count | Source | 198 | 2.23M | bool empty() const { return size_ == 0; } |
bssl::Array<unsigned short>::empty() const Line | Count | Source | 198 | 152k | bool empty() const { return size_ == 0; } |
bssl::Array<ssl_credential_st*>::empty() const Line | Count | Source | 198 | 24.0k | bool empty() const { return size_ == 0; } |
|
199 | | |
200 | 1.95M | const T &operator[](size_t i) const { |
201 | 1.95M | BSSL_CHECK(i < size_); |
202 | 1.95M | return data_[i]; |
203 | 1.95M | } |
204 | 4.65M | T &operator[](size_t i) { |
205 | 4.65M | BSSL_CHECK(i < size_); |
206 | 4.65M | return data_[i]; |
207 | 4.65M | } bssl::Array<unsigned short>::operator[](unsigned long) Line | Count | Source | 204 | 1.96M | T &operator[](size_t i) { | 205 | 1.96M | BSSL_CHECK(i < size_); | 206 | 1.96M | return data_[i]; | 207 | 1.96M | } |
bssl::Array<unsigned char>::operator[](unsigned long) Line | Count | Source | 204 | 1.71M | T &operator[](size_t i) { | 205 | 1.71M | BSSL_CHECK(i < size_); | 206 | 1.71M | return data_[i]; | 207 | 1.71M | } |
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 | 204 | 813k | T &operator[](size_t i) { | 205 | 813k | BSSL_CHECK(i < size_); | 206 | 813k | return data_[i]; | 207 | 813k | } |
bssl::Array<bool>::operator[](unsigned long) Line | Count | Source | 204 | 132k | T &operator[](size_t i) { | 205 | 132k | BSSL_CHECK(i < size_); | 206 | 132k | return data_[i]; | 207 | 132k | } |
bssl::Array<ssl_credential_st*>::operator[](unsigned long) Line | Count | Source | 204 | 24.0k | T &operator[](size_t i) { | 205 | 24.0k | BSSL_CHECK(i < size_); | 206 | 24.0k | return data_[i]; | 207 | 24.0k | } |
|
208 | | |
209 | | T &front() { |
210 | | BSSL_CHECK(size_ != 0); |
211 | | return data_[0]; |
212 | | } |
213 | | const T &front() const { |
214 | | BSSL_CHECK(size_ != 0); |
215 | | return data_[0]; |
216 | | } |
217 | | T &back() { |
218 | | BSSL_CHECK(size_ != 0); |
219 | | return data_[size_ - 1]; |
220 | | } |
221 | | const T &back() const { |
222 | | BSSL_CHECK(size_ != 0); |
223 | | return data_[size_ - 1]; |
224 | | } |
225 | | |
226 | 221k | T *begin() { return data_; }bssl::Array<unsigned short>::begin() Line | Count | Source | 226 | 185k | T *begin() { return data_; } |
bssl::Array<ssl_credential_st*>::begin() Line | Count | Source | 226 | 24.0k | T *begin() { return data_; } |
bssl::Array<unsigned char>::begin() Line | Count | Source | 226 | 12.2k | T *begin() { return data_; } |
|
227 | 0 | const T *begin() const { return data_; } |
228 | 233k | T *end() { return data_ + size_; }bssl::Array<unsigned short>::end() Line | Count | Source | 228 | 185k | T *end() { return data_ + size_; } |
bssl::Array<ssl_credential_st*>::end() Line | Count | Source | 228 | 24.0k | T *end() { return data_ + size_; } |
bssl::Array<unsigned char>::end() Line | Count | Source | 228 | 24.5k | T *end() { return data_ + size_; } |
|
229 | 0 | const T *end() const { return data_ + size_; } |
230 | | |
231 | 11.9M | void Reset() { Reset(nullptr, 0); }bssl::Array<unsigned char>::Reset() Line | Count | Source | 231 | 9.94M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<unsigned short>::Reset() Line | Count | Source | 231 | 1.67M | void Reset() { Reset(nullptr, 0); } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset() bssl::Array<unsigned int>::Reset() Line | Count | Source | 231 | 232k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<ssl_credential_st*>::Reset() Line | Count | Source | 231 | 48.0k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<int>::Reset() Line | Count | Source | 231 | 9.81k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bool>::Reset() Line | Count | Source | 231 | 67.7k | void Reset() { Reset(nullptr, 0); } |
|
232 | | |
233 | | // Reset releases the current contents of the array and takes ownership of the |
234 | | // raw pointer supplied by the caller. |
235 | 12.8M | void Reset(T *new_data, size_t new_size) { |
236 | 12.8M | std::destroy_n(data_, size_); |
237 | 12.8M | OPENSSL_free(data_); |
238 | 12.8M | data_ = new_data; |
239 | 12.8M | size_ = new_size; |
240 | 12.8M | } bssl::Array<unsigned char>::Reset(unsigned char*, unsigned long) Line | Count | Source | 235 | 10.8M | void Reset(T *new_data, size_t new_size) { | 236 | 10.8M | std::destroy_n(data_, size_); | 237 | 10.8M | OPENSSL_free(data_); | 238 | 10.8M | data_ = new_data; | 239 | 10.8M | size_ = new_size; | 240 | 10.8M | } |
bssl::Array<unsigned short>::Reset(unsigned short*, unsigned long) Line | Count | Source | 235 | 1.67M | void Reset(T *new_data, size_t new_size) { | 236 | 1.67M | std::destroy_n(data_, size_); | 237 | 1.67M | OPENSSL_free(data_); | 238 | 1.67M | data_ = new_data; | 239 | 1.67M | size_ = new_size; | 240 | 1.67M | } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset(unsigned long*, unsigned long) bssl::Array<unsigned int>::Reset(unsigned int*, unsigned long) Line | Count | Source | 235 | 232k | void Reset(T *new_data, size_t new_size) { | 236 | 232k | std::destroy_n(data_, size_); | 237 | 232k | OPENSSL_free(data_); | 238 | 232k | data_ = new_data; | 239 | 232k | size_ = new_size; | 240 | 232k | } |
bssl::Array<ssl_credential_st*>::Reset(ssl_credential_st**, unsigned long) Line | Count | Source | 235 | 48.0k | void Reset(T *new_data, size_t new_size) { | 236 | 48.0k | std::destroy_n(data_, size_); | 237 | 48.0k | OPENSSL_free(data_); | 238 | 48.0k | data_ = new_data; | 239 | 48.0k | size_ = new_size; | 240 | 48.0k | } |
bssl::Array<int>::Reset(int*, unsigned long) Line | Count | Source | 235 | 9.81k | void Reset(T *new_data, size_t new_size) { | 236 | 9.81k | std::destroy_n(data_, size_); | 237 | 9.81k | OPENSSL_free(data_); | 238 | 9.81k | data_ = new_data; | 239 | 9.81k | size_ = new_size; | 240 | 9.81k | } |
bssl::Array<bool>::Reset(bool*, unsigned long) Line | Count | Source | 235 | 67.7k | void Reset(T *new_data, size_t new_size) { | 236 | 67.7k | std::destroy_n(data_, size_); | 237 | 67.7k | OPENSSL_free(data_); | 238 | 67.7k | data_ = new_data; | 239 | 67.7k | size_ = new_size; | 240 | 67.7k | } |
|
241 | | |
242 | | // Release releases ownership of the array to a raw pointer supplied by the |
243 | | // caller. |
244 | 457k | void Release(T **out, size_t *out_size) { |
245 | 457k | *out = data_; |
246 | 457k | *out_size = size_; |
247 | 457k | data_ = nullptr; |
248 | 457k | size_ = 0; |
249 | 457k | } bssl::Array<unsigned char>::Release(unsigned char**, unsigned long*) Line | Count | Source | 244 | 406k | void Release(T **out, size_t *out_size) { | 245 | 406k | *out = data_; | 246 | 406k | *out_size = size_; | 247 | 406k | data_ = nullptr; | 248 | 406k | size_ = 0; | 249 | 406k | } |
bssl::Array<unsigned short>::Release(unsigned short**, unsigned long*) Line | Count | Source | 244 | 34.2k | void Release(T **out, size_t *out_size) { | 245 | 34.2k | *out = data_; | 246 | 34.2k | *out_size = size_; | 247 | 34.2k | data_ = nullptr; | 248 | 34.2k | size_ = 0; | 249 | 34.2k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Release(unsigned int**, unsigned long*) bssl::Array<bool>::Release(bool**, unsigned long*) Line | Count | Source | 244 | 16.9k | void Release(T **out, size_t *out_size) { | 245 | 16.9k | *out = data_; | 246 | 16.9k | *out_size = size_; | 247 | 16.9k | data_ = nullptr; | 248 | 16.9k | size_ = 0; | 249 | 16.9k | } |
|
250 | | |
251 | | // Init replaces the array with a newly-allocated array of |new_size| |
252 | | // value-constructed copies of |T|. It returns true on success and false on |
253 | | // error. If |T| is a primitive type like |uint8_t|, value-construction means |
254 | | // it will be zero-initialized. |
255 | 92.8k | [[nodiscard]] bool Init(size_t new_size) { |
256 | 92.8k | if (!InitUninitialized(new_size)) { |
257 | 0 | return false; |
258 | 0 | } |
259 | 92.8k | std::uninitialized_value_construct_n(data_, size_); |
260 | 92.8k | return true; |
261 | 92.8k | } Unexecuted instantiation: bssl::Array<unsigned long>::Init(unsigned long) bssl::Array<unsigned int>::Init(unsigned long) Line | Count | Source | 255 | 9.47k | [[nodiscard]] bool Init(size_t new_size) { | 256 | 9.47k | if (!InitUninitialized(new_size)) { | 257 | 0 | return false; | 258 | 0 | } | 259 | 9.47k | std::uninitialized_value_construct_n(data_, size_); | 260 | 9.47k | return true; | 261 | 9.47k | } |
bssl::Array<unsigned char>::Init(unsigned long) Line | Count | Source | 255 | 78.5k | [[nodiscard]] bool Init(size_t new_size) { | 256 | 78.5k | if (!InitUninitialized(new_size)) { | 257 | 0 | return false; | 258 | 0 | } | 259 | 78.5k | std::uninitialized_value_construct_n(data_, size_); | 260 | 78.5k | return true; | 261 | 78.5k | } |
bssl::Array<int>::Init(unsigned long) Line | Count | Source | 255 | 4.90k | [[nodiscard]] bool Init(size_t new_size) { | 256 | 4.90k | if (!InitUninitialized(new_size)) { | 257 | 0 | return false; | 258 | 0 | } | 259 | 4.90k | std::uninitialized_value_construct_n(data_, size_); | 260 | 4.90k | return true; | 261 | 4.90k | } |
|
262 | | |
263 | | // InitForOverwrite behaves like |Init| but it default-constructs each element |
264 | | // instead. This means that, if |T| is a primitive type, the array will be |
265 | | // uninitialized and thus must be filled in by the caller. |
266 | 332k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { |
267 | 332k | if (!InitUninitialized(new_size)) { |
268 | 0 | return false; |
269 | 0 | } |
270 | 332k | std::uninitialized_default_construct_n(data_, size_); |
271 | 332k | return true; |
272 | 332k | } bssl::Array<unsigned char>::InitForOverwrite(unsigned long) Line | Count | Source | 266 | 138k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 267 | 138k | if (!InitUninitialized(new_size)) { | 268 | 0 | return false; | 269 | 0 | } | 270 | 138k | std::uninitialized_default_construct_n(data_, size_); | 271 | 138k | return true; | 272 | 138k | } |
bssl::Array<unsigned short>::InitForOverwrite(unsigned long) Line | Count | Source | 266 | 152k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 267 | 152k | if (!InitUninitialized(new_size)) { | 268 | 0 | return false; | 269 | 0 | } | 270 | 152k | std::uninitialized_default_construct_n(data_, size_); | 271 | 152k | return true; | 272 | 152k | } |
bssl::Array<bool>::InitForOverwrite(unsigned long) Line | Count | Source | 266 | 16.9k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 267 | 16.9k | if (!InitUninitialized(new_size)) { | 268 | 0 | return false; | 269 | 0 | } | 270 | 16.9k | std::uninitialized_default_construct_n(data_, size_); | 271 | 16.9k | return true; | 272 | 16.9k | } |
bssl::Array<ssl_credential_st*>::InitForOverwrite(unsigned long) Line | Count | Source | 266 | 24.0k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 267 | 24.0k | if (!InitUninitialized(new_size)) { | 268 | 0 | return false; | 269 | 0 | } | 270 | 24.0k | std::uninitialized_default_construct_n(data_, size_); | 271 | 24.0k | return true; | 272 | 24.0k | } |
|
273 | | |
274 | | // CopyFrom replaces the array with a newly-allocated copy of |in|. It returns |
275 | | // true on success and false on error. |
276 | 1.52M | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
277 | 1.52M | if (!InitUninitialized(in.size())) { |
278 | 0 | return false; |
279 | 0 | } |
280 | 1.52M | std::uninitialized_copy(in.begin(), in.end(), data_); |
281 | 1.52M | return true; |
282 | 1.52M | } bssl::Array<unsigned char>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 276 | 1.06M | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 277 | 1.06M | if (!InitUninitialized(in.size())) { | 278 | 0 | return false; | 279 | 0 | } | 280 | 1.06M | std::uninitialized_copy(in.begin(), in.end(), data_); | 281 | 1.06M | return true; | 282 | 1.06M | } |
bssl::Array<bool>::CopyFrom(bssl::Span<bool const, 18446744073709551615ul>) Line | Count | Source | 276 | 16.9k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 277 | 16.9k | if (!InitUninitialized(in.size())) { | 278 | 0 | return false; | 279 | 0 | } | 280 | 16.9k | std::uninitialized_copy(in.begin(), in.end(), data_); | 281 | 16.9k | return true; | 282 | 16.9k | } |
bssl::Array<unsigned short>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) Line | Count | Source | 276 | 339k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 277 | 339k | if (!InitUninitialized(in.size())) { | 278 | 0 | return false; | 279 | 0 | } | 280 | 339k | std::uninitialized_copy(in.begin(), in.end(), data_); | 281 | 339k | return true; | 282 | 339k | } |
bssl::Array<unsigned int>::CopyFrom(bssl::Span<unsigned int const, 18446744073709551615ul>) Line | Count | Source | 276 | 109k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 277 | 109k | if (!InitUninitialized(in.size())) { | 278 | 0 | return false; | 279 | 0 | } | 280 | 109k | std::uninitialized_copy(in.begin(), in.end(), data_); | 281 | 109k | return true; | 282 | 109k | } |
|
283 | | |
284 | | // Shrink shrinks the stored size of the array to |new_size|. It crashes if |
285 | | // the new size is larger. Note this does not shrink the allocation itself. |
286 | 20.5k | void Shrink(size_t new_size) { |
287 | 20.5k | if (new_size > size_) { |
288 | 0 | abort(); |
289 | 0 | } |
290 | 20.5k | std::destroy_n(data_ + new_size, size_ - new_size); |
291 | 20.5k | size_ = new_size; |
292 | 20.5k | } Unexecuted instantiation: bssl::Array<unsigned char>::Shrink(unsigned long) bssl::Array<unsigned short>::Shrink(unsigned long) Line | Count | Source | 286 | 3.59k | void Shrink(size_t new_size) { | 287 | 3.59k | if (new_size > size_) { | 288 | 0 | abort(); | 289 | 0 | } | 290 | 3.59k | std::destroy_n(data_ + new_size, size_ - new_size); | 291 | 3.59k | size_ = new_size; | 292 | 3.59k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Shrink(unsigned long) bssl::Array<bool>::Shrink(unsigned long) Line | Count | Source | 286 | 16.9k | void Shrink(size_t new_size) { | 287 | 16.9k | if (new_size > size_) { | 288 | 0 | abort(); | 289 | 0 | } | 290 | 16.9k | std::destroy_n(data_ + new_size, size_ - new_size); | 291 | 16.9k | size_ = new_size; | 292 | 16.9k | } |
|
293 | | |
294 | | private: |
295 | | // InitUninitialized replaces the array with a newly-allocated array of |
296 | | // |new_size| elements, but whose constructor has not yet run. On success, the |
297 | | // elements must be constructed before returning control to the caller. |
298 | 1.95M | bool InitUninitialized(size_t new_size) { |
299 | 1.95M | Reset(); |
300 | 1.95M | if (new_size == 0) { |
301 | 977k | return true; |
302 | 977k | } |
303 | | |
304 | 976k | if (new_size > SIZE_MAX / sizeof(T)) { |
305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
306 | 0 | return false; |
307 | 0 | } |
308 | 976k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); |
309 | 976k | if (data_ == nullptr) { |
310 | 0 | return false; |
311 | 0 | } |
312 | 976k | size_ = new_size; |
313 | 976k | return true; |
314 | 976k | } bssl::Array<unsigned char>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 1.28M | bool InitUninitialized(size_t new_size) { | 299 | 1.28M | Reset(); | 300 | 1.28M | if (new_size == 0) { | 301 | 749k | return true; | 302 | 749k | } | 303 | | | 304 | 531k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 531k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 531k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 531k | size_ = new_size; | 313 | 531k | return true; | 314 | 531k | } |
bssl::Array<unsigned short>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 492k | bool InitUninitialized(size_t new_size) { | 299 | 492k | Reset(); | 300 | 492k | if (new_size == 0) { | 301 | 219k | return true; | 302 | 219k | } | 303 | | | 304 | 272k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 272k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 272k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 272k | size_ = new_size; | 313 | 272k | return true; | 314 | 272k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::InitUninitialized(unsigned long) bssl::Array<unsigned int>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 118k | bool InitUninitialized(size_t new_size) { | 299 | 118k | Reset(); | 300 | 118k | if (new_size == 0) { | 301 | 0 | return true; | 302 | 0 | } | 303 | | | 304 | 118k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 118k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 118k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 118k | size_ = new_size; | 313 | 118k | return true; | 314 | 118k | } |
bssl::Array<int>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 4.90k | bool InitUninitialized(size_t new_size) { | 299 | 4.90k | Reset(); | 300 | 4.90k | if (new_size == 0) { | 301 | 0 | return true; | 302 | 0 | } | 303 | | | 304 | 4.90k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 4.90k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 4.90k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 4.90k | size_ = new_size; | 313 | 4.90k | return true; | 314 | 4.90k | } |
bssl::Array<bool>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 33.8k | bool InitUninitialized(size_t new_size) { | 299 | 33.8k | Reset(); | 300 | 33.8k | if (new_size == 0) { | 301 | 8.25k | return true; | 302 | 8.25k | } | 303 | | | 304 | 25.6k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 25.6k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 25.6k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 25.6k | size_ = new_size; | 313 | 25.6k | return true; | 314 | 25.6k | } |
bssl::Array<ssl_credential_st*>::InitUninitialized(unsigned long) Line | Count | Source | 298 | 24.0k | bool InitUninitialized(size_t new_size) { | 299 | 24.0k | Reset(); | 300 | 24.0k | if (new_size == 0) { | 301 | 0 | return true; | 302 | 0 | } | 303 | | | 304 | 24.0k | if (new_size > SIZE_MAX / sizeof(T)) { | 305 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 306 | 0 | return false; | 307 | 0 | } | 308 | 24.0k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 309 | 24.0k | if (data_ == nullptr) { | 310 | 0 | return false; | 311 | 0 | } | 312 | 24.0k | size_ = new_size; | 313 | 24.0k | return true; | 314 | 24.0k | } |
|
315 | | |
316 | | T *data_ = nullptr; |
317 | | size_t size_ = 0; |
318 | | }; |
319 | | |
320 | | // Vector<T> is a resizable array of elements of |T|. |
321 | | template <typename T> |
322 | | class Vector { |
323 | | public: |
324 | 392k | Vector() = default; bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Vector() Line | Count | Source | 324 | 14.9k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 324 | 114k | Vector() = default; |
bssl::Vector<bssl::CertCompressionAlg>::Vector() Line | Count | Source | 324 | 4.85k | Vector() = default; |
bssl::Vector<bssl::ALPSConfig>::Vector() Line | Count | Source | 324 | 109k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 324 | 74.7k | Vector() = default; |
bssl::Vector<unsigned long>::Vector() Line | Count | Source | 324 | 74.7k | Vector() = default; |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Vector() |
325 | | Vector(const Vector &) = delete; |
326 | | Vector(Vector &&other) { *this = std::move(other); } |
327 | 392k | ~Vector() { clear(); }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 327 | 14.9k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 327 | 114k | ~Vector() { clear(); } |
bssl::Vector<bssl::CertCompressionAlg>::~Vector() Line | Count | Source | 327 | 4.84k | ~Vector() { clear(); } |
bssl::Vector<bssl::ALPSConfig>::~Vector() Line | Count | Source | 327 | 109k | ~Vector() { clear(); } |
bssl::Vector<unsigned long>::~Vector() Line | Count | Source | 327 | 74.7k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 327 | 74.7k | ~Vector() { clear(); } |
|
328 | | |
329 | | Vector &operator=(const Vector &) = delete; |
330 | | Vector &operator=(Vector &&other) { |
331 | | clear(); |
332 | | std::swap(data_, other.data_); |
333 | | std::swap(size_, other.size_); |
334 | | std::swap(capacity_, other.capacity_); |
335 | | return *this; |
336 | | } |
337 | | |
338 | | const T *data() const { return data_; } |
339 | | T *data() { return data_; } |
340 | 30.9M | size_t size() const { return size_; }bssl::Vector<bssl::CertCompressionAlg>::size() const Line | Count | Source | 340 | 57 | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::size() const Line | Count | Source | 340 | 48.0k | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::size() const Line | Count | Source | 340 | 30.9M | size_t size() const { return size_; } |
|
341 | 18.4M | bool empty() const { return size_ == 0; }bssl::Vector<bssl::ALPSConfig>::empty() const Line | Count | Source | 341 | 91.6k | bool empty() const { return size_ == 0; } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::empty() const Line | Count | Source | 341 | 6 | bool empty() const { return size_ == 0; } |
bssl::Vector<unsigned long>::empty() const Line | Count | Source | 341 | 18.3M | bool empty() const { return size_ == 0; } |
|
342 | | |
343 | 0 | const T &operator[](size_t i) const { |
344 | 0 | BSSL_CHECK(i < size_); |
345 | 0 | return data_[i]; |
346 | 0 | } Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::operator[](unsigned long) const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::operator[](unsigned long) const |
347 | 30.9M | T &operator[](size_t i) { |
348 | 30.9M | BSSL_CHECK(i < size_); |
349 | 30.9M | return data_[i]; |
350 | 30.9M | } Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::operator[](unsigned long) bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::operator[](unsigned long) Line | Count | Source | 347 | 30.9M | T &operator[](size_t i) { | 348 | 30.9M | BSSL_CHECK(i < size_); | 349 | 30.9M | return data_[i]; | 350 | 30.9M | } |
|
351 | | |
352 | | T &front() { |
353 | | BSSL_CHECK(size_ != 0); |
354 | | return data_[0]; |
355 | | } |
356 | | const T &front() const { |
357 | | BSSL_CHECK(size_ != 0); |
358 | | return data_[0]; |
359 | | } |
360 | 18.3M | T &back() { |
361 | 18.3M | BSSL_CHECK(size_ != 0); |
362 | 18.3M | return data_[size_ - 1]; |
363 | 18.3M | } |
364 | | const T &back() const { |
365 | | BSSL_CHECK(size_ != 0); |
366 | | return data_[size_ - 1]; |
367 | | } |
368 | | |
369 | 244k | T *begin() { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() Line | Count | Source | 369 | 436 | T *begin() { return data_; } |
bssl::Vector<bssl::CertCompressionAlg>::begin() Line | Count | Source | 369 | 45.8k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::begin() Line | Count | Source | 369 | 109k | T *begin() { return data_; } |
bssl::Vector<bssl::ALPSConfig>::begin() Line | Count | Source | 369 | 32 | T *begin() { return data_; } |
bssl::Vector<unsigned long>::begin() Line | Count | Source | 369 | 42.5k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::begin() Line | Count | Source | 369 | 46.2k | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::begin() |
370 | 44.0k | const T *begin() const { return data_; }Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() const bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::begin() const Line | Count | Source | 370 | 44.0k | const T *begin() const { return data_; } |
|
371 | 244k | T *end() { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() Line | Count | Source | 371 | 436 | T *end() { return data_ + size_; } |
bssl::Vector<bssl::CertCompressionAlg>::end() Line | Count | Source | 371 | 45.8k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::end() Line | Count | Source | 371 | 109k | T *end() { return data_ + size_; } |
bssl::Vector<bssl::ALPSConfig>::end() Line | Count | Source | 371 | 32 | T *end() { return data_ + size_; } |
bssl::Vector<unsigned long>::end() Line | Count | Source | 371 | 42.5k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::end() Line | Count | Source | 371 | 46.2k | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::end() |
372 | 44.0k | const T *end() const { return data_ + size_; }Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() const bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::end() const Line | Count | Source | 372 | 44.0k | const T *end() const { return data_ + size_; } |
|
373 | | |
374 | 481k | void clear() { |
375 | 481k | std::destroy_n(data_, size_); |
376 | 481k | OPENSSL_free(data_); |
377 | 481k | data_ = nullptr; |
378 | 481k | size_ = 0; |
379 | 481k | capacity_ = 0; |
380 | 481k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::clear() Line | Count | Source | 374 | 14.9k | void clear() { | 375 | 14.9k | std::destroy_n(data_, size_); | 376 | 14.9k | OPENSSL_free(data_); | 377 | 14.9k | data_ = nullptr; | 378 | 14.9k | size_ = 0; | 379 | 14.9k | capacity_ = 0; | 380 | 14.9k | } |
bssl::Vector<bssl::ALPSConfig>::clear() Line | Count | Source | 374 | 109k | void clear() { | 375 | 109k | std::destroy_n(data_, size_); | 376 | 109k | OPENSSL_free(data_); | 377 | 109k | data_ = nullptr; | 378 | 109k | size_ = 0; | 379 | 109k | capacity_ = 0; | 380 | 109k | } |
bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 374 | 114k | void clear() { | 375 | 114k | std::destroy_n(data_, size_); | 376 | 114k | OPENSSL_free(data_); | 377 | 114k | data_ = nullptr; | 378 | 114k | size_ = 0; | 379 | 114k | capacity_ = 0; | 380 | 114k | } |
bssl::Vector<bssl::CertCompressionAlg>::clear() Line | Count | Source | 374 | 4.84k | void clear() { | 375 | 4.84k | std::destroy_n(data_, size_); | 376 | 4.84k | OPENSSL_free(data_); | 377 | 4.84k | data_ = nullptr; | 378 | 4.84k | size_ = 0; | 379 | 4.84k | capacity_ = 0; | 380 | 4.84k | } |
bssl::Vector<unsigned long>::clear() Line | Count | Source | 374 | 117k | void clear() { | 375 | 117k | std::destroy_n(data_, size_); | 376 | 117k | OPENSSL_free(data_); | 377 | 117k | data_ = nullptr; | 378 | 117k | size_ = 0; | 379 | 117k | capacity_ = 0; | 380 | 117k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 374 | 121k | void clear() { | 375 | 121k | std::destroy_n(data_, size_); | 376 | 121k | OPENSSL_free(data_); | 377 | 121k | data_ = nullptr; | 378 | 121k | size_ = 0; | 379 | 121k | capacity_ = 0; | 380 | 121k | } |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::clear() |
381 | | |
382 | 18.3M | void pop_back() { |
383 | 18.3M | BSSL_CHECK(size_ != 0); |
384 | 18.3M | std::destroy_at(&data_[size_ - 1]); |
385 | 18.3M | size_--; |
386 | 18.3M | } |
387 | | |
388 | | // Push adds |elem| at the end of the internal array, growing if necessary. It |
389 | | // returns false when allocation fails. |
390 | 18.7M | [[nodiscard]] bool Push(T elem) { |
391 | 18.7M | if (!MaybeGrow()) { |
392 | 0 | return false; |
393 | 0 | } |
394 | 18.7M | new (&data_[size_]) T(std::move(elem)); |
395 | 18.7M | size_++; |
396 | 18.7M | return true; |
397 | 18.7M | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>) Line | Count | Source | 390 | 6 | [[nodiscard]] bool Push(T elem) { | 391 | 6 | if (!MaybeGrow()) { | 392 | 0 | return false; | 393 | 0 | } | 394 | 6 | new (&data_[size_]) T(std::move(elem)); | 395 | 6 | size_++; | 396 | 6 | return true; | 397 | 6 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter>) 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 | 390 | 18.3M | [[nodiscard]] bool Push(T elem) { | 391 | 18.3M | if (!MaybeGrow()) { | 392 | 0 | return false; | 393 | 0 | } | 394 | 18.3M | new (&data_[size_]) T(std::move(elem)); | 395 | 18.3M | size_++; | 396 | 18.3M | return true; | 397 | 18.3M | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bignum_st, bssl::internal::Deleter>) Line | Count | Source | 390 | 317k | [[nodiscard]] bool Push(T elem) { | 391 | 317k | if (!MaybeGrow()) { | 392 | 0 | return false; | 393 | 0 | } | 394 | 317k | new (&data_[size_]) T(std::move(elem)); | 395 | 317k | size_++; | 396 | 317k | return true; | 397 | 317k | } |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Push(v3_ext_method const*) |
398 | | |
399 | | // CopyFrom replaces the contents of the array with a copy of |in|. It returns |
400 | | // true on success and false on allocation error. |
401 | | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
402 | | Array<T> copy; |
403 | | if (!copy.CopyFrom(in)) { |
404 | | return false; |
405 | | } |
406 | | |
407 | | clear(); |
408 | | copy.Release(&data_, &size_); |
409 | | capacity_ = size_; |
410 | | return true; |
411 | | } |
412 | | |
413 | | private: |
414 | | // If there is no room for one more element, creates a new backing array with |
415 | | // double the size of the old one and copies elements over. |
416 | 18.7M | bool MaybeGrow() { |
417 | | // No need to grow if we have room for one more T. |
418 | 18.7M | if (size_ < capacity_) { |
419 | 18.6M | return true; |
420 | 18.6M | } |
421 | 88.8k | size_t new_capacity = kDefaultSize; |
422 | 88.8k | if (capacity_ > 0) { |
423 | | // Double the array's size if it's safe to do so. |
424 | 3.92k | if (capacity_ > SIZE_MAX / 2) { |
425 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
426 | 0 | return false; |
427 | 0 | } |
428 | 3.92k | new_capacity = capacity_ * 2; |
429 | 3.92k | } |
430 | 88.8k | if (new_capacity > SIZE_MAX / sizeof(T)) { |
431 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
432 | 0 | return false; |
433 | 0 | } |
434 | 88.8k | T *new_data = |
435 | 88.8k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); |
436 | 88.8k | if (new_data == nullptr) { |
437 | 0 | return false; |
438 | 0 | } |
439 | 88.8k | size_t new_size = size_; |
440 | 88.8k | std::uninitialized_move(begin(), end(), new_data); |
441 | 88.8k | clear(); |
442 | 88.8k | data_ = new_data; |
443 | 88.8k | size_ = new_size; |
444 | 88.8k | capacity_ = new_capacity; |
445 | 88.8k | return true; |
446 | 88.8k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::MaybeGrow() Line | Count | Source | 416 | 6 | bool MaybeGrow() { | 417 | | // No need to grow if we have room for one more T. | 418 | 6 | if (size_ < capacity_) { | 419 | 0 | return true; | 420 | 0 | } | 421 | 6 | size_t new_capacity = kDefaultSize; | 422 | 6 | if (capacity_ > 0) { | 423 | | // Double the array's size if it's safe to do so. | 424 | 0 | if (capacity_ > SIZE_MAX / 2) { | 425 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 426 | 0 | return false; | 427 | 0 | } | 428 | 0 | new_capacity = capacity_ * 2; | 429 | 0 | } | 430 | 6 | if (new_capacity > SIZE_MAX / sizeof(T)) { | 431 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 432 | 0 | return false; | 433 | 0 | } | 434 | 6 | T *new_data = | 435 | 6 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 436 | 6 | if (new_data == nullptr) { | 437 | 0 | return false; | 438 | 0 | } | 439 | 6 | size_t new_size = size_; | 440 | 6 | std::uninitialized_move(begin(), end(), new_data); | 441 | 6 | clear(); | 442 | 6 | data_ = new_data; | 443 | 6 | size_ = new_size; | 444 | 6 | capacity_ = new_capacity; | 445 | 6 | return true; | 446 | 6 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<ssl_credential_st, bssl::internal::Deleter> >::MaybeGrow() Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::MaybeGrow() Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::MaybeGrow() bssl::Vector<unsigned long>::MaybeGrow() Line | Count | Source | 416 | 18.3M | bool MaybeGrow() { | 417 | | // No need to grow if we have room for one more T. | 418 | 18.3M | if (size_ < capacity_) { | 419 | 18.3M | return true; | 420 | 18.3M | } | 421 | 42.5k | size_t new_capacity = kDefaultSize; | 422 | 42.5k | if (capacity_ > 0) { | 423 | | // Double the array's size if it's safe to do so. | 424 | 0 | if (capacity_ > SIZE_MAX / 2) { | 425 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 426 | 0 | return false; | 427 | 0 | } | 428 | 0 | new_capacity = capacity_ * 2; | 429 | 0 | } | 430 | 42.5k | if (new_capacity > SIZE_MAX / sizeof(T)) { | 431 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 432 | 0 | return false; | 433 | 0 | } | 434 | 42.5k | T *new_data = | 435 | 42.5k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 436 | 42.5k | if (new_data == nullptr) { | 437 | 0 | return false; | 438 | 0 | } | 439 | 42.5k | size_t new_size = size_; | 440 | 42.5k | std::uninitialized_move(begin(), end(), new_data); | 441 | 42.5k | clear(); | 442 | 42.5k | data_ = new_data; | 443 | 42.5k | size_ = new_size; | 444 | 42.5k | capacity_ = new_capacity; | 445 | 42.5k | return true; | 446 | 42.5k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::MaybeGrow() Line | Count | Source | 416 | 317k | bool MaybeGrow() { | 417 | | // No need to grow if we have room for one more T. | 418 | 317k | if (size_ < capacity_) { | 419 | 270k | return true; | 420 | 270k | } | 421 | 46.2k | size_t new_capacity = kDefaultSize; | 422 | 46.2k | if (capacity_ > 0) { | 423 | | // Double the array's size if it's safe to do so. | 424 | 3.92k | if (capacity_ > SIZE_MAX / 2) { | 425 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 426 | 0 | return false; | 427 | 0 | } | 428 | 3.92k | new_capacity = capacity_ * 2; | 429 | 3.92k | } | 430 | 46.2k | if (new_capacity > SIZE_MAX / sizeof(T)) { | 431 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 432 | 0 | return false; | 433 | 0 | } | 434 | 46.2k | T *new_data = | 435 | 46.2k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 436 | 46.2k | if (new_data == nullptr) { | 437 | 0 | return false; | 438 | 0 | } | 439 | 46.2k | size_t new_size = size_; | 440 | 46.2k | std::uninitialized_move(begin(), end(), new_data); | 441 | 46.2k | clear(); | 442 | 46.2k | data_ = new_data; | 443 | 46.2k | size_ = new_size; | 444 | 46.2k | capacity_ = new_capacity; | 445 | 46.2k | return true; | 446 | 46.2k | } |
Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::MaybeGrow() |
447 | | |
448 | | // data_ is a pointer to |capacity_| objects of size |T|, the first |size_| of |
449 | | // which are constructed. |
450 | | T *data_ = nullptr; |
451 | | // |size_| is the number of elements stored in this Vector. |
452 | | size_t size_ = 0; |
453 | | // |capacity_| is the number of elements allocated in this Vector. |
454 | | size_t capacity_ = 0; |
455 | | // |kDefaultSize| is the default initial size of the backing array. |
456 | | static constexpr size_t kDefaultSize = 16; |
457 | | }; |
458 | | |
459 | | // A PackedSize is an integer that can store values from 0 to N, represented as |
460 | | // a minimal-width integer. |
461 | | template <size_t N> |
462 | | using PackedSize = std::conditional_t< |
463 | | N <= 0xff, uint8_t, |
464 | | std::conditional_t<N <= 0xffff, uint16_t, |
465 | | std::conditional_t<N <= 0xffffffff, uint32_t, size_t>>>; |
466 | | |
467 | | // An InplaceVector is like a Vector, but stores up to N elements inline in the |
468 | | // object. It is inspired by std::inplace_vector in C++26. |
469 | | template <typename T, size_t N> |
470 | | class InplaceVector { |
471 | | public: |
472 | | using value_type = std::remove_cv_t<T>; |
473 | | |
474 | 3.45M | InplaceVector() = default; bssl::InplaceVector<unsigned short, 2ul>::InplaceVector() Line | Count | Source | 474 | 44.5k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 48ul>::InplaceVector() Line | Count | Source | 474 | 1.89M | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::InplaceVector() Line | Count | Source | 474 | 140k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 32ul>::InplaceVector() Line | Count | Source | 474 | 685k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 12ul>::InplaceVector() Line | Count | Source | 474 | 554k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::InplaceVector() Line | Count | Source | 474 | 41.1k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::InplaceVector() Line | Count | Source | 474 | 10.3k | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::InplaceVector() Line | Count | Source | 474 | 38.8k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::InplaceVector() Line | Count | Source | 474 | 38.8k | InplaceVector() = default; |
bssl::InplaceVector<crypto_iovec_st, 16ul>::InplaceVector() Line | Count | Source | 474 | 3.93k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::InplaceVector() |
475 | | InplaceVector(const InplaceVector &other) { *this = other; } |
476 | 41.9k | InplaceVector(InplaceVector &&other) { *this = std::move(other); } |
477 | 3.49M | ~InplaceVector() { clear(); }bssl::InplaceVector<unsigned short, 2ul>::~InplaceVector() Line | Count | Source | 477 | 44.5k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 48ul>::~InplaceVector() Line | Count | Source | 477 | 1.93M | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::~InplaceVector() Line | Count | Source | 477 | 140k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 32ul>::~InplaceVector() Line | Count | Source | 477 | 685k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 12ul>::~InplaceVector() Line | Count | Source | 477 | 554k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::~InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::~InplaceVector() Line | Count | Source | 477 | 41.1k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::~InplaceVector() Line | Count | Source | 477 | 10.3k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::~InplaceVector() Line | Count | Source | 477 | 38.8k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::~InplaceVector() Line | Count | Source | 477 | 38.8k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::~InplaceVector() bssl::InplaceVector<crypto_iovec_st, 16ul>::~InplaceVector() Line | Count | Source | 477 | 3.93k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::~InplaceVector() |
478 | 270k | InplaceVector &operator=(const InplaceVector &other) { |
479 | 270k | if (this != &other) { |
480 | 270k | CopyFrom(other); |
481 | 270k | } |
482 | 270k | return *this; |
483 | 270k | } bssl::InplaceVector<unsigned char, 32ul>::operator=(bssl::InplaceVector<unsigned char, 32ul> const&) Line | Count | Source | 478 | 190k | InplaceVector &operator=(const InplaceVector &other) { | 479 | 190k | if (this != &other) { | 480 | 190k | CopyFrom(other); | 481 | 190k | } | 482 | 190k | return *this; | 483 | 190k | } |
bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul> const&) Line | Count | Source | 478 | 80.0k | InplaceVector &operator=(const InplaceVector &other) { | 479 | 80.0k | if (this != &other) { | 480 | 80.0k | CopyFrom(other); | 481 | 80.0k | } | 482 | 80.0k | return *this; | 483 | 80.0k | } |
|
484 | 113k | InplaceVector &operator=(InplaceVector &&other) { |
485 | 113k | clear(); |
486 | 113k | std::uninitialized_move(other.begin(), other.end(), data()); |
487 | 113k | size_ = other.size(); |
488 | 113k | return *this; |
489 | 113k | } |
490 | | |
491 | 1.09M | const T *data() const { return reinterpret_cast<const T *>(storage_); }Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::data() const bssl::InplaceVector<unsigned short, 2ul>::data() const Line | Count | Source | 491 | 44.0k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 48ul>::data() const Line | Count | Source | 491 | 307k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() const Line | Count | Source | 491 | 735k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 12ul>::data() const bssl::InplaceVector<crypto_iovec_st, 16ul>::data() const Line | Count | Source | 491 | 3.93k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
|
492 | 7.82M | T *data() { return reinterpret_cast<T *>(storage_); }bssl::InplaceVector<unsigned char, 12ul>::data() Line | Count | Source | 492 | 978k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::data() Line | Count | Source | 492 | 339k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned short, 2ul>::data() Line | Count | Source | 492 | 352k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() Line | Count | Source | 492 | 1.90M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 48ul>::data() Line | Count | Source | 492 | 3.50M | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::data() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::data() Line | Count | Source | 492 | 243k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::data() Line | Count | Source | 492 | 217k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::data() Line | Count | Source | 492 | 31.9k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::data() Line | Count | Source | 492 | 233k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::data() Line | Count | Source | 492 | 15.7k | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::data() |
493 | 2.36M | size_t size() const { return size_; }bssl::InplaceVector<unsigned char, 12ul>::size() const Line | Count | Source | 493 | 210k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::size() const bssl::InplaceVector<unsigned short, 2ul>::size() const Line | Count | Source | 493 | 132k | size_t size() const { return size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::size() const Line | Count | Source | 493 | 94.1k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 48ul>::size() const Line | Count | Source | 493 | 609k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 32ul>::size() const Line | Count | Source | 493 | 780k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::size() const Line | Count | Source | 493 | 176k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::size() const Line | Count | Source | 493 | 292k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::size() const Line | Count | Source | 493 | 44.1k | size_t size() const { return size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::size() const Line | Count | Source | 493 | 14.1k | size_t size() const { return size_; } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::size() const Line | Count | Source | 493 | 7.87k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::size() const Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::size() const Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::size() const |
494 | 1.67M | static constexpr size_t capacity() { return N; }bssl::InplaceVector<unsigned short, 2ul>::capacity() Line | Count | Source | 494 | 88.0k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::capacity() Line | Count | Source | 494 | 94.1k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 32ul>::capacity() Line | Count | Source | 494 | 610k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 48ul>::capacity() Line | Count | Source | 494 | 513k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 12ul>::capacity() Line | Count | Source | 494 | 214k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::capacity() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::capacity() Line | Count | Source | 494 | 29.7k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::capacity() Line | Count | Source | 494 | 88.0k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::capacity() Line | Count | Source | 494 | 19.2k | 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 | 494 | 3.93k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::capacity() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::capacity() bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::capacity() Line | Count | Source | 494 | 7.76k | static constexpr size_t capacity() { return N; } |
|
495 | 127k | bool empty() const { return size_ == 0; }bssl::InplaceVector<unsigned char, 12ul>::empty() const Line | Count | Source | 495 | 62.9k | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::empty() const bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::empty() const Line | Count | Source | 495 | 4.27k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 48ul>::empty() const Line | Count | Source | 495 | 2.20k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 32ul>::empty() const Line | Count | Source | 495 | 43.5k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::empty() const Line | Count | Source | 495 | 14.9k | bool empty() const { return size_ == 0; } |
|
496 | | |
497 | | const T &operator[](size_t i) const { |
498 | | BSSL_CHECK(i < size_); |
499 | | return data()[i]; |
500 | | } |
501 | 456k | T &operator[](size_t i) { |
502 | 456k | BSSL_CHECK(i < size_); |
503 | 456k | return data()[i]; |
504 | 456k | } bssl::InplaceVector<unsigned short, 2ul>::operator[](unsigned long) Line | Count | Source | 501 | 220k | T &operator[](size_t i) { | 502 | 220k | BSSL_CHECK(i < size_); | 503 | 220k | return data()[i]; | 504 | 220k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::operator[](unsigned long) Line | Count | Source | 501 | 9.03k | T &operator[](size_t i) { | 502 | 9.03k | BSSL_CHECK(i < size_); | 503 | 9.03k | return data()[i]; | 504 | 9.03k | } |
bssl::InplaceVector<unsigned char, 12ul>::operator[](unsigned long) Line | Count | Source | 501 | 49.2k | T &operator[](size_t i) { | 502 | 49.2k | BSSL_CHECK(i < size_); | 503 | 49.2k | return data()[i]; | 504 | 49.2k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::operator[](unsigned long) Line | Count | Source | 501 | 66.7k | T &operator[](size_t i) { | 502 | 66.7k | BSSL_CHECK(i < size_); | 503 | 66.7k | return data()[i]; | 504 | 66.7k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::operator[](unsigned long) Line | Count | Source | 501 | 2.32k | T &operator[](size_t i) { | 502 | 2.32k | BSSL_CHECK(i < size_); | 503 | 2.32k | return data()[i]; | 504 | 2.32k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::operator[](unsigned long) Line | Count | Source | 501 | 2.40k | T &operator[](size_t i) { | 502 | 2.40k | BSSL_CHECK(i < size_); | 503 | 2.40k | return data()[i]; | 504 | 2.40k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::operator[](unsigned long) Line | Count | Source | 501 | 106k | T &operator[](size_t i) { | 502 | 106k | BSSL_CHECK(i < size_); | 503 | 106k | return data()[i]; | 504 | 106k | } |
|
505 | | |
506 | | T &front() { |
507 | | BSSL_CHECK(size_ != 0); |
508 | | return data()[0]; |
509 | | } |
510 | | const T &front() const { |
511 | | BSSL_CHECK(size_ != 0); |
512 | | return data()[0]; |
513 | | } |
514 | | T &back() { |
515 | | BSSL_CHECK(size_ != 0); |
516 | | return data()[size_ - 1]; |
517 | | } |
518 | | const T &back() const { |
519 | | BSSL_CHECK(size_ != 0); |
520 | | return data()[size_ - 1]; |
521 | | } |
522 | | |
523 | 212k | T *begin() { return data(); }bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::begin() Line | Count | Source | 523 | 2.54k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::begin() Line | Count | Source | 523 | 4.61k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::begin() Line | Count | Source | 523 | 72.7k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::begin() Line | Count | Source | 523 | 18.9k | T *begin() { return data(); } |
bssl::InplaceVector<unsigned char, 48ul>::begin() Line | Count | Source | 523 | 113k | T *begin() { return data(); } |
|
524 | | const T *begin() const { return data(); } |
525 | 250k | T *end() { return data() + size_; }bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::end() Line | Count | Source | 525 | 5.08k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::end() Line | Count | Source | 525 | 4.61k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::end() Line | Count | Source | 525 | 108k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::end() Line | Count | Source | 525 | 18.9k | T *end() { return data() + size_; } |
bssl::InplaceVector<unsigned char, 48ul>::end() Line | Count | Source | 525 | 113k | T *end() { return data() + size_; } |
|
526 | | const T *end() const { return data() + size_; } |
527 | | |
528 | 4.84M | void clear() { Shrink(0); }bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::clear() Line | Count | Source | 528 | 229k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned short, 2ul>::clear() Line | Count | Source | 528 | 44.5k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 48ul>::clear() Line | Count | Source | 528 | 2.46M | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 32ul>::clear() Line | Count | Source | 528 | 1.21M | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 12ul>::clear() Line | Count | Source | 528 | 704k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::clear() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::clear() Line | Count | Source | 528 | 53.1k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::clear() Line | Count | Source | 528 | 10.3k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::clear() Line | Count | Source | 528 | 69.4k | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::clear() Line | Count | Source | 528 | 38.8k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::clear() bssl::InplaceVector<crypto_iovec_st, 16ul>::clear() Line | Count | Source | 528 | 7.87k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::clear() |
529 | | |
530 | | void pop_back() { |
531 | | BSSL_CHECK(size_ != 0); |
532 | | Shrink(size_ - 1); |
533 | | } |
534 | | |
535 | | // Shrink resizes the vector to |new_size|, which must not be larger than the |
536 | | // current size. Unlike |Resize|, this can be called when |T| is not |
537 | | // default-constructible. |
538 | 4.84M | void Shrink(size_t new_size) { |
539 | 4.84M | BSSL_CHECK(new_size <= size_); |
540 | 4.84M | std::destroy_n(data() + new_size, size_ - new_size); |
541 | 4.84M | size_ = static_cast<PackedSize<N>>(new_size); |
542 | 4.84M | } bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::Shrink(unsigned long) Line | Count | Source | 538 | 229k | void Shrink(size_t new_size) { | 539 | 229k | BSSL_CHECK(new_size <= size_); | 540 | 229k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 229k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 229k | } |
bssl::InplaceVector<unsigned short, 2ul>::Shrink(unsigned long) Line | Count | Source | 538 | 44.5k | void Shrink(size_t new_size) { | 539 | 44.5k | BSSL_CHECK(new_size <= size_); | 540 | 44.5k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 44.5k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 44.5k | } |
bssl::InplaceVector<unsigned char, 32ul>::Shrink(unsigned long) Line | Count | Source | 538 | 1.21M | void Shrink(size_t new_size) { | 539 | 1.21M | BSSL_CHECK(new_size <= size_); | 540 | 1.21M | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 1.21M | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 1.21M | } |
bssl::InplaceVector<unsigned char, 48ul>::Shrink(unsigned long) Line | Count | Source | 538 | 2.46M | void Shrink(size_t new_size) { | 539 | 2.46M | BSSL_CHECK(new_size <= size_); | 540 | 2.46M | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 2.46M | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 2.46M | } |
bssl::InplaceVector<unsigned char, 12ul>::Shrink(unsigned long) Line | Count | Source | 538 | 704k | void Shrink(size_t new_size) { | 539 | 704k | BSSL_CHECK(new_size <= size_); | 540 | 704k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 704k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 704k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::Shrink(unsigned long) bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::Shrink(unsigned long) Line | Count | Source | 538 | 53.1k | void Shrink(size_t new_size) { | 539 | 53.1k | BSSL_CHECK(new_size <= size_); | 540 | 53.1k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 53.1k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 53.1k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::Shrink(unsigned long) Line | Count | Source | 538 | 10.3k | void Shrink(size_t new_size) { | 539 | 10.3k | BSSL_CHECK(new_size <= size_); | 540 | 10.3k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 10.3k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 10.3k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::Shrink(unsigned long) Line | Count | Source | 538 | 69.4k | void Shrink(size_t new_size) { | 539 | 69.4k | BSSL_CHECK(new_size <= size_); | 540 | 69.4k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 69.4k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 69.4k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::Shrink(unsigned long) Line | Count | Source | 538 | 42.8k | void Shrink(size_t new_size) { | 539 | 42.8k | BSSL_CHECK(new_size <= size_); | 540 | 42.8k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 42.8k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 42.8k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Shrink(unsigned long) bssl::InplaceVector<crypto_iovec_st, 16ul>::Shrink(unsigned long) Line | Count | Source | 538 | 7.87k | void Shrink(size_t new_size) { | 539 | 7.87k | BSSL_CHECK(new_size <= size_); | 540 | 7.87k | std::destroy_n(data() + new_size, size_ - new_size); | 541 | 7.87k | size_ = static_cast<PackedSize<N>>(new_size); | 542 | 7.87k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Shrink(unsigned long) |
543 | | |
544 | | // TryResize resizes the vector to |new_size| and returns true, or returns |
545 | | // false if |new_size| is too large. Any newly-added elements are |
546 | | // value-initialized. |
547 | 6.30k | [[nodiscard]] bool TryResize(size_t new_size) { |
548 | 6.30k | if (new_size <= size_) { |
549 | 0 | Shrink(new_size); |
550 | 0 | return true; |
551 | 0 | } |
552 | 6.30k | if (new_size > capacity()) { |
553 | 0 | return false; |
554 | 0 | } |
555 | 6.30k | std::uninitialized_value_construct_n(data() + size_, new_size - size_); |
556 | 6.30k | size_ = static_cast<PackedSize<N>>(new_size); |
557 | 6.30k | return true; |
558 | 6.30k | } |
559 | | |
560 | | // TryResizeForOverwrite behaves like |TryResize|, but newly-added elements |
561 | | // are default-initialized, so POD types may contain uninitialized values that |
562 | | // the caller is responsible for filling in. |
563 | 176k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { |
564 | 176k | if (new_size <= size_) { |
565 | 137 | Shrink(new_size); |
566 | 137 | return true; |
567 | 137 | } |
568 | 176k | if (new_size > capacity()) { |
569 | 0 | return false; |
570 | 0 | } |
571 | 176k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); |
572 | 176k | size_ = static_cast<PackedSize<N>>(new_size); |
573 | 176k | return true; |
574 | 176k | } bssl::InplaceVector<unsigned char, 32ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 563 | 81.3k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 564 | 81.3k | if (new_size <= size_) { | 565 | 34 | Shrink(new_size); | 566 | 34 | return true; | 567 | 34 | } | 568 | 81.2k | if (new_size > capacity()) { | 569 | 0 | return false; | 570 | 0 | } | 571 | 81.2k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 572 | 81.2k | size_ = static_cast<PackedSize<N>>(new_size); | 573 | 81.2k | return true; | 574 | 81.2k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 563 | 95.3k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 564 | 95.3k | if (new_size <= size_) { | 565 | 103 | Shrink(new_size); | 566 | 103 | return true; | 567 | 103 | } | 568 | 95.2k | if (new_size > capacity()) { | 569 | 0 | return false; | 570 | 0 | } | 571 | 95.2k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 572 | 95.2k | size_ = static_cast<PackedSize<N>>(new_size); | 573 | 95.2k | return true; | 574 | 95.2k | } |
|
575 | | |
576 | | // TryCopyFrom sets the vector to a copy of |in| and returns true, or returns |
577 | | // false if |in| is too large. |
578 | 1.09M | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { |
579 | 1.09M | if (in.size() > capacity()) { |
580 | 864 | return false; |
581 | 864 | } |
582 | 1.09M | clear(); |
583 | 1.09M | std::uninitialized_copy(in.begin(), in.end(), data()); |
584 | 1.09M | size_ = in.size(); |
585 | 1.09M | return true; |
586 | 1.09M | } bssl::InplaceVector<unsigned char, 48ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 578 | 412k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 579 | 412k | if (in.size() > capacity()) { | 580 | 27 | return false; | 581 | 27 | } | 582 | 412k | clear(); | 583 | 412k | std::uninitialized_copy(in.begin(), in.end(), data()); | 584 | 412k | size_ = in.size(); | 585 | 412k | return true; | 586 | 412k | } |
bssl::InplaceVector<unsigned char, 12ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 578 | 150k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 579 | 150k | if (in.size() > capacity()) { | 580 | 0 | return false; | 581 | 0 | } | 582 | 150k | clear(); | 583 | 150k | std::uninitialized_copy(in.begin(), in.end(), data()); | 584 | 150k | size_ = in.size(); | 585 | 150k | return true; | 586 | 150k | } |
bssl::InplaceVector<unsigned char, 32ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 578 | 529k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 579 | 529k | if (in.size() > capacity()) { | 580 | 837 | return false; | 581 | 837 | } | 582 | 528k | clear(); | 583 | 528k | std::uninitialized_copy(in.begin(), in.end(), data()); | 584 | 528k | size_ = in.size(); | 585 | 528k | return true; | 586 | 529k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::TryCopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<crypto_iovec_st, 16ul>::TryCopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) Line | Count | Source | 578 | 3.93k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 579 | 3.93k | if (in.size() > capacity()) { | 580 | 0 | return false; | 581 | 0 | } | 582 | 3.93k | clear(); | 583 | 3.93k | std::uninitialized_copy(in.begin(), in.end(), data()); | 584 | 3.93k | size_ = in.size(); | 585 | 3.93k | return true; | 586 | 3.93k | } |
|
587 | | |
588 | | // TryAppend appends the vector by a copy of |in| and returns true, or |
589 | | // returns false if |in| is too large. |
590 | 0 | [[nodiscard]] bool TryAppend(Span<const T> in) { |
591 | 0 | if (in.size() > capacity() - size()) { |
592 | 0 | return false; |
593 | 0 | } |
594 | 0 | std::uninitialized_copy(in.begin(), in.end(), &data()[size_]); |
595 | 0 | size_ += in.size(); |
596 | 0 | return true; |
597 | 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>) |
598 | | |
599 | | // TryPushBack appends |val| to the vector and returns a pointer to the |
600 | | // newly-inserted value, or nullptr if the vector is at capacity. |
601 | 327k | [[nodiscard]] T *TryPushBack(T val) { |
602 | 327k | if (size() >= capacity()) { |
603 | 0 | return nullptr; |
604 | 0 | } |
605 | 327k | T *ret = &data()[size_]; |
606 | 327k | new (ret) T(std::move(val)); |
607 | 327k | size_++; |
608 | 327k | return ret; |
609 | 327k | } bssl::InplaceVector<unsigned short, 2ul>::TryPushBack(unsigned short) Line | Count | Source | 601 | 88.0k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 88.0k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 88.0k | T *ret = &data()[size_]; | 606 | 88.0k | new (ret) T(std::move(val)); | 607 | 88.0k | size_++; | 608 | 88.0k | return ret; | 609 | 88.0k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::TryPushBack(std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>) Line | Count | Source | 601 | 94.1k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 94.1k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 94.1k | T *ret = &data()[size_]; | 606 | 94.1k | new (ret) T(std::move(val)); | 607 | 94.1k | size_++; | 608 | 94.1k | return ret; | 609 | 94.1k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::TryPushBack(bssl::DTLSOutgoingMessage) Line | Count | Source | 601 | 29.7k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 29.7k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 29.7k | T *ret = &data()[size_]; | 606 | 29.7k | new (ret) T(std::move(val)); | 607 | 29.7k | size_++; | 608 | 29.7k | return ret; | 609 | 29.7k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::TryPushBack(bssl::DTLSRecordNumber) Line | Count | Source | 601 | 88.0k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 88.0k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 88.0k | T *ret = &data()[size_]; | 606 | 88.0k | new (ret) T(std::move(val)); | 607 | 88.0k | size_++; | 608 | 88.0k | return ret; | 609 | 88.0k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::TryPushBack(bssl::DTLSSentRecord) Line | Count | Source | 601 | 19.2k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 19.2k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 19.2k | T *ret = &data()[size_]; | 606 | 19.2k | new (ret) T(std::move(val)); | 607 | 19.2k | size_++; | 608 | 19.2k | return ret; | 609 | 19.2k | } |
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 | 601 | 7.76k | [[nodiscard]] T *TryPushBack(T val) { | 602 | 7.76k | if (size() >= capacity()) { | 603 | 0 | return nullptr; | 604 | 0 | } | 605 | 7.76k | T *ret = &data()[size_]; | 606 | 7.76k | new (ret) T(std::move(val)); | 607 | 7.76k | size_++; | 608 | 7.76k | return ret; | 609 | 7.76k | } |
|
610 | | |
611 | | // The following methods behave like their |Try*| counterparts, but abort the |
612 | | // program on failure. |
613 | 6.30k | void Resize(size_t size) { BSSL_CHECK(TryResize(size)); } |
614 | 176k | void ResizeForOverwrite(size_t size) { |
615 | 176k | BSSL_CHECK(TryResizeForOverwrite(size)); |
616 | 176k | } bssl::InplaceVector<unsigned char, 32ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 614 | 81.3k | void ResizeForOverwrite(size_t size) { | 615 | 81.3k | BSSL_CHECK(TryResizeForOverwrite(size)); | 616 | 81.3k | } |
bssl::InplaceVector<unsigned char, 48ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 614 | 95.3k | void ResizeForOverwrite(size_t size) { | 615 | 95.3k | BSSL_CHECK(TryResizeForOverwrite(size)); | 616 | 95.3k | } |
|
617 | 530k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); }bssl::InplaceVector<unsigned char, 12ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 617 | 116k | 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 | 617 | 236k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 48ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 617 | 173k | 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 | 617 | 3.93k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
|
618 | 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>) |
619 | 115k | T &PushBack(T val) { |
620 | 115k | T *ret = TryPushBack(std::move(val)); |
621 | 115k | BSSL_CHECK(ret != nullptr); |
622 | 115k | return *ret; |
623 | 115k | } bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::PushBack(bssl::DTLSRecordNumber) Line | Count | Source | 619 | 88.0k | T &PushBack(T val) { | 620 | 88.0k | T *ret = TryPushBack(std::move(val)); | 621 | 88.0k | BSSL_CHECK(ret != nullptr); | 622 | 88.0k | return *ret; | 623 | 88.0k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::PushBack(bssl::DTLSSentRecord) Line | Count | Source | 619 | 19.2k | T &PushBack(T val) { | 620 | 19.2k | T *ret = TryPushBack(std::move(val)); | 621 | 19.2k | BSSL_CHECK(ret != nullptr); | 622 | 19.2k | return *ret; | 623 | 19.2k | } |
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 | 619 | 7.76k | T &PushBack(T val) { | 620 | 7.76k | T *ret = TryPushBack(std::move(val)); | 621 | 7.76k | BSSL_CHECK(ret != nullptr); | 622 | 7.76k | return *ret; | 623 | 7.76k | } |
|
624 | | |
625 | | template <typename Pred> |
626 | 39.3k | void EraseIf(Pred pred) { |
627 | | // See if anything needs to be erased at all. This avoids a self-move. |
628 | 39.3k | auto iter = std::find_if(begin(), end(), pred); |
629 | 39.3k | if (iter == end()) { |
630 | 35.2k | return; |
631 | 35.2k | } |
632 | | |
633 | | // Elements before the first to be erased may be left as-is. |
634 | 4.05k | size_t new_size = iter - begin(); |
635 | | // Swap all subsequent elements in if they are to be kept. |
636 | 6.43k | for (size_t i = new_size + 1; i < size(); i++) { |
637 | 2.37k | if (!pred((*this)[i])) { |
638 | 12 | (*this)[new_size] = std::move((*this)[i]); |
639 | 12 | new_size++; |
640 | 12 | } |
641 | 2.37k | } |
642 | | |
643 | 4.05k | Shrink(new_size); |
644 | 4.05k | } |
645 | | |
646 | | private: |
647 | | alignas(T) char storage_[sizeof(T[N])]; |
648 | | PackedSize<N> size_ = 0; |
649 | | }; |
650 | | |
651 | | |
652 | | BSSL_NAMESPACE_END |
653 | | |
654 | | #endif // OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |