/src/boringssl/crypto/mem_internal.h
Line | Count | Source |
1 | | // Copyright 2025 The BoringSSL Authors |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |
16 | | #define OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |
17 | | |
18 | | #include <openssl/mem.h> |
19 | | |
20 | | #include <algorithm> |
21 | | #include <memory> |
22 | | #include <type_traits> |
23 | | #include <utility> |
24 | | |
25 | | #include <openssl/err.h> |
26 | | #include <openssl/span.h> |
27 | | |
28 | | #include "internal.h" |
29 | | |
30 | | |
31 | | BSSL_NAMESPACE_BEGIN |
32 | | |
33 | | // Internal allocation-dependent functions. |
34 | | // |
35 | | // This header is separate from crypto/internal.h because there are some files |
36 | | // which must avoid `OPENSSL_malloc`, to avoid a circular dependency, but |
37 | | // need other support routines in crypto/internal.h. (See |
38 | | // `_BORINGSSL_PROHIBIT_OPENSSL_MALLOC`.) |
39 | | |
40 | | |
41 | | // Memory allocation. |
42 | | |
43 | | // New behaves like `new` but uses `OPENSSL_malloc` for memory allocation. It |
44 | | // returns nullptr on allocation error. It only implements single-object |
45 | | // allocation and not new T[n]. |
46 | | // |
47 | | // When called with no arguments, it performs value-initialization, not |
48 | | // default-initialization. This means that, if it selects a non-user-provided |
49 | | // constructor, the object will be zero-initialized. (As in any C++ type, once |
50 | | // `T` gains a user-provided constructor, it is responsible for initializing |
51 | | // all fields explicitly.) |
52 | | // |
53 | | // Note: unlike `new`, this does not support non-public constructors. |
54 | | template <typename T, typename... Args> |
55 | 10.2M | T *New(Args &&...args) { |
56 | 10.2M | void *t = OPENSSL_malloc(sizeof(T)); |
57 | 10.2M | if (t == nullptr) { |
58 | 0 | return nullptr; |
59 | 0 | } |
60 | 10.2M | return new (t) T(std::forward<Args>(args)...); |
61 | 10.2M | } Unexecuted instantiation: bssl::ECHConfig* bssl::New<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) bssl::SSLECHKeys* bssl::New<bssl::SSLECHKeys>() Line | Count | Source | 55 | 14.8k | T *New(Args &&...args) { | 56 | 14.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.8k | } |
bssl::ECHServerConfig* bssl::New<bssl::ECHServerConfig>() Line | Count | Source | 55 | 12.1k | T *New(Args &&...args) { | 56 | 12.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 12.1k | } |
bssl::SSLPAKEShare* bssl::New<bssl::SSLPAKEShare>() Line | Count | Source | 55 | 46 | T *New(Args &&...args) { | 56 | 46 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 46 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 46 | return new (t) T(std::forward<Args>(args)...); | 61 | 46 | } |
Unexecuted instantiation: bssl::spake2plus::Prover* bssl::New<bssl::spake2plus::Prover>() bssl::SSLCipherPreferenceList* bssl::New<bssl::SSLCipherPreferenceList>() Line | Count | Source | 55 | 20.0k | T *New(Args &&...args) { | 56 | 20.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 20.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 20.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 20.0k | } |
bssl::SSL_HANDSHAKE_HINTS* bssl::New<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 55 | 77.8k | T *New(Args &&...args) { | 56 | 77.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 77.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 77.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 77.8k | } |
bssl::SSL_HANDSHAKE* bssl::New<bssl::SSL_HANDSHAKE, ssl_st*&>(ssl_st*&) Line | Count | Source | 55 | 155k | T *New(Args &&...args) { | 56 | 155k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 155k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 155k | return new (t) T(std::forward<Args>(args)...); | 61 | 155k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 55 | 235k | T *New(Args &&...args) { | 56 | 235k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 235k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 235k | return new (t) T(std::forward<Args>(args)...); | 61 | 235k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 55 | 131k | T *New(Args &&...args) { | 56 | 131k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 131k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 131k | return new (t) T(std::forward<Args>(args)...); | 61 | 131k | } |
bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 55 | 122k | T *New(Args &&...args) { | 56 | 122k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 122k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 122k | return new (t) T(std::forward<Args>(args)...); | 61 | 122k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
Unexecuted instantiation: bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::ECKeyShare* bssl::New<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 55 | 17.4k | T *New(Args &&...args) { | 56 | 17.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 17.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 17.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 17.4k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519KeyShare* bssl::New<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 55 | 80.1k | T *New(Args &&...args) { | 56 | 80.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 80.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 80.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 80.1k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519Kyber768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519Kyber768KeyShare>() Line | Count | Source | 55 | 277 | T *New(Args &&...args) { | 56 | 277 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 277 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 277 | return new (t) T(std::forward<Args>(args)...); | 61 | 277 | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519MLKEM768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 55 | 51.6k | T *New(Args &&...args) { | 56 | 51.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 51.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 51.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 51.6k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::MLKEM1024KeyShare* bssl::New<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 55 | 30 | T *New(Args &&...args) { | 56 | 30 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 30 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 30 | return new (t) T(std::forward<Args>(args)...); | 61 | 30 | } |
bssl::SSLContext* bssl::New<bssl::SSLContext, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 55 | 5.14k | T *New(Args &&...args) { | 56 | 5.14k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.14k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.14k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.14k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 55 | 5.14k | T *New(Args &&...args) { | 56 | 5.14k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.14k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.14k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.14k | } |
ssl_st* bssl::New<ssl_st, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
bssl::SSL_CONFIG* bssl::New<bssl::SSL_CONFIG, ssl_st*>(ssl_st*&&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
bssl::TicketKey* bssl::New<bssl::TicketKey>() Line | Count | Source | 55 | 413 | T *New(Args &&...args) { | 56 | 413 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 413 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 413 | return new (t) T(std::forward<Args>(args)...); | 61 | 413 | } |
ssl_session_st* bssl::New<ssl_session_st, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 229k | T *New(Args &&...args) { | 56 | 229k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 229k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 229k | return new (t) T(std::forward<Args>(args)...); | 61 | 229k | } |
tls13_enc.cc:bssl::(anonymous namespace)::NullRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 55 | 40.0k | T *New(Args &&...args) { | 56 | 40.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 40.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 40.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 40.0k | } |
Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES128RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES256RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: bssl::spake2plus::Verifier* bssl::New<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >(std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter>&&) Line | Count | Source | 55 | 363 | T *New(Args &&...args) { | 56 | 363 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 363 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 363 | return new (t) T(std::forward<Args>(args)...); | 61 | 363 | } |
bssl::DTLSIncomingMessage* bssl::New<bssl::DTLSIncomingMessage>() Line | Count | Source | 55 | 48.1k | T *New(Args &&...args) { | 56 | 48.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 48.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 48.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 48.1k | } |
bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>* bssl::New<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 55 | 10.7k | T *New(Args &&...args) { | 56 | 10.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 10.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 10.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 10.7k | } |
bssl::DTLS1_STATE* bssl::New<bssl::DTLS1_STATE>() Line | Count | Source | 55 | 40.6k | T *New(Args &&...args) { | 56 | 40.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 40.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 40.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 40.6k | } |
bssl::DTLSPrevReadEpoch* bssl::New<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 55 | 30.0k | T *New(Args &&...args) { | 56 | 30.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 30.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 30.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 30.0k | } |
bssl::SSL3_STATE* bssl::New<bssl::SSL3_STATE>() Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
bssl::EC_WRAPPED_SCALAR* bssl::New<bssl::EC_WRAPPED_SCALAR>() Line | Count | Source | 55 | 3.68k | T *New(Args &&...args) { | 56 | 3.68k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 3.68k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 3.68k | return new (t) T(std::forward<Args>(args)...); | 61 | 3.68k | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::keygen_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>() Line | Count | Source | 55 | 406 | T *New(Args &&...args) { | 56 | 406 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 406 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 406 | return new (t) T(std::forward<Args>(args)...); | 61 | 406 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::sign_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::fips::verify_self_test()::Values* bssl::New<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>() bignum_st* bssl::New<bignum_st>() Line | Count | Source | 55 | 723k | T *New(Args &&...args) { | 56 | 723k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 723k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 723k | return new (t) T(std::forward<Args>(args)...); | 61 | 723k | } |
bssl::BignumCtx* bssl::New<bssl::BignumCtx>() Line | Count | Source | 55 | 76.9k | T *New(Args &&...args) { | 56 | 76.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 76.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 76.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 76.9k | } |
bn_mont_ctx_st* bssl::New<bn_mont_ctx_st>() Line | Count | Source | 55 | 24.6k | T *New(Args &&...args) { | 56 | 24.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 24.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 24.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 24.6k | } |
Unexecuted instantiation: bn_gencb_st* bssl::New<bn_gencb_st>() Unexecuted instantiation: evp_aead_ctx_st* bssl::New<evp_aead_ctx_st>() Unexecuted instantiation: evp_cipher_ctx_st* bssl::New<evp_cipher_ctx_st>() Unexecuted instantiation: cmac_ctx_st* bssl::New<cmac_ctx_st>() Unexecuted instantiation: bssl::DHImpl* bssl::New<bssl::DHImpl>() Unexecuted instantiation: env_md_ctx_st* bssl::New<env_md_ctx_st>() Unexecuted instantiation: bssl::ECCustomGroup* bssl::New<bssl::ECCustomGroup, ec_method_st const*>(ec_method_st const*&&) ec_point_st* bssl::New<ec_point_st>() Line | Count | Source | 55 | 150k | T *New(Args &&...args) { | 56 | 150k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 150k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 150k | return new (t) T(std::forward<Args>(args)...); | 61 | 150k | } |
bssl::ECKey* bssl::New<bssl::ECKey, engine_st const*&>(engine_st const*&) Line | Count | Source | 55 | 60.0k | T *New(Args &&...args) { | 56 | 60.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 60.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 60.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 60.0k | } |
hmac_ctx_st* bssl::New<hmac_ctx_st>() Line | Count | Source | 55 | 32.3k | T *New(Args &&...args) { | 56 | 32.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 32.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 32.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 32.3k | } |
bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>() Line | Count | Source | 55 | 417 | T *New(Args &&...args) { | 56 | 417 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 417 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 417 | return new (t) T(std::forward<Args>(args)...); | 61 | 417 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>() Line | Count | Source | 55 | 248 | T *New(Args &&...args) { | 56 | 248 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 248 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 248 | return new (t) T(std::forward<Args>(args)...); | 61 | 248 | } |
Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values* bssl::New<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: ctr_drbg_state_st* bssl::New<ctr_drbg_state_st>() bcm.cc:(anonymous namespace)::rand_thread_state* bssl::New<(anonymous namespace)::rand_thread_state>() Line | Count | Source | 55 | 8 | T *New(Args &&...args) { | 56 | 8 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 8 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 8 | return new (t) T(std::forward<Args>(args)...); | 61 | 8 | } |
bssl::RSAImpl* bssl::New<bssl::RSAImpl, engine_st const*&>(engine_st const*&) Line | Count | Source | 55 | 140k | T *New(Args &&...args) { | 56 | 140k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 140k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 140k | return new (t) T(std::forward<Args>(args)...); | 61 | 140k | } |
bssl::Bio* bssl::New<bssl::Bio, bio_method_st const*&>(bio_method_st const*&) Line | Count | Source | 55 | 66.7k | T *New(Args &&...args) { | 56 | 66.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 66.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 66.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 66.7k | } |
bio_method_st* bssl::New<bio_method_st>() Line | Count | Source | 55 | 6 | T *New(Args &&...args) { | 56 | 6 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6 | return new (t) T(std::forward<Args>(args)...); | 61 | 6 | } |
buf_mem_st* bssl::New<buf_mem_st>() Line | Count | Source | 55 | 481k | T *New(Args &&...args) { | 56 | 481k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 481k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 481k | return new (t) T(std::forward<Args>(args)...); | 61 | 481k | } |
ecdsa_sig_st* bssl::New<ecdsa_sig_st>() Line | Count | Source | 55 | 19.7k | T *New(Args &&...args) { | 56 | 19.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 19.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 19.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 19.7k | } |
Unexecuted instantiation: engine_st* bssl::New<engine_st>() bssl::EvpPkey* bssl::New<bssl::EvpPkey>() Line | Count | Source | 55 | 254k | T *New(Args &&...args) { | 56 | 254k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 254k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 254k | return new (t) T(std::forward<Args>(args)...); | 61 | 254k | } |
bssl::EvpPkeyCtx* bssl::New<bssl::EvpPkeyCtx>() Line | Count | Source | 55 | 124k | T *New(Args &&...args) { | 56 | 124k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 124k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 124k | return new (t) T(std::forward<Args>(args)...); | 61 | 124k | } |
Unexecuted instantiation: p_dh.cc:(anonymous namespace)::DH_PKEY_CTX* bssl::New<(anonymous namespace)::DH_PKEY_CTX>() p_ec.cc:(anonymous namespace)::EC_PKEY_CTX* bssl::New<(anonymous namespace)::EC_PKEY_CTX>() Line | Count | Source | 55 | 35.1k | T *New(Args &&...args) { | 56 | 35.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 35.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 35.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 35.1k | } |
p_ed25519.cc:(anonymous namespace)::ED25519_KEY* bssl::New<(anonymous namespace)::ED25519_KEY>() Line | Count | Source | 55 | 256 | T *New(Args &&...args) { | 56 | 256 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 256 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 256 | return new (t) T(std::forward<Args>(args)...); | 61 | 256 | } |
Unexecuted instantiation: p_hkdf.cc:(anonymous namespace)::HKDF_PKEY_CTX* bssl::New<(anonymous namespace)::HKDF_PKEY_CTX>() Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, MLDSA44_public_key const&>(MLDSA44_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 55 | 264 | T *New(Args &&...args) { | 56 | 264 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 264 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 264 | return new (t) T(std::forward<Args>(args)...); | 61 | 264 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 55 | 30 | T *New(Args &&...args) { | 56 | 30 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 30 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 30 | return new (t) T(std::forward<Args>(args)...); | 61 | 30 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::MldsaPkeyCtx* bssl::New<(anonymous namespace)::MldsaPkeyCtx>() Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, MLDSA65_public_key const&>(MLDSA65_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 426 | T *New(Args &&...args) { | 56 | 426 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 426 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 426 | return new (t) T(std::forward<Args>(args)...); | 61 | 426 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 11 | T *New(Args &&...args) { | 56 | 11 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 11 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 11 | return new (t) T(std::forward<Args>(args)...); | 61 | 11 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, MLDSA87_public_key const&>(MLDSA87_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 55 | 439 | T *New(Args &&...args) { | 56 | 439 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 439 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 439 | return new (t) T(std::forward<Args>(args)...); | 61 | 439 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 55 | 22 | T *New(Args &&...args) { | 56 | 22 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 22 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 22 | return new (t) T(std::forward<Args>(args)...); | 61 | 22 | } |
Unexecuted instantiation: p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, MLKEM768_public_key const&>(MLKEM768_public_key const&) p_mlkem.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 70 | T *New(Args &&...args) { | 56 | 70 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 70 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 70 | return new (t) T(std::forward<Args>(args)...); | 61 | 70 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 137 | T *New(Args &&...args) { | 56 | 137 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 137 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 137 | return new (t) T(std::forward<Args>(args)...); | 61 | 137 | } |
Unexecuted instantiation: p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, MLKEM1024_public_key const&>(MLKEM1024_public_key const&) p_mlkem.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 55 | 84 | T *New(Args &&...args) { | 56 | 84 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 84 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 84 | return new (t) T(std::forward<Args>(args)...); | 61 | 84 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 55 | 165 | T *New(Args &&...args) { | 56 | 165 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 165 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 165 | return new (t) T(std::forward<Args>(args)...); | 61 | 165 | } |
p_rsa.cc:(anonymous namespace)::RSA_PKEY_CTX* bssl::New<(anonymous namespace)::RSA_PKEY_CTX>() Line | Count | Source | 55 | 89.4k | T *New(Args &&...args) { | 56 | 89.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 89.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 89.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 89.4k | } |
p_x25519.cc:(anonymous namespace)::X25519_KEY* bssl::New<(anonymous namespace)::X25519_KEY>() Line | Count | Source | 55 | 521 | T *New(Args &&...args) { | 56 | 521 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 521 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 521 | return new (t) T(std::forward<Args>(args)...); | 61 | 521 | } |
Unexecuted instantiation: bssl::ExDataFuncs* bssl::New<bssl::ExDataFuncs>() Unexecuted instantiation: evp_hpke_key_st* bssl::New<evp_hpke_key_st>() Unexecuted instantiation: evp_hpke_ctx_st* bssl::New<evp_hpke_ctx_st>() bssl::_LHASH* bssl::New<bssl::_LHASH>() Line | Count | Source | 55 | 5.14k | T *New(Args &&...args) { | 56 | 5.14k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.14k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.14k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.14k | } |
bssl::LHASH_ITEM* bssl::New<bssl::LHASH_ITEM>() Line | Count | Source | 55 | 11.3k | T *New(Args &&...args) { | 56 | 11.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 11.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 11.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 11.3k | } |
Unexecuted instantiation: bssl::CryptoBufferPool* bssl::New<bssl::CryptoBufferPool>() Unexecuted instantiation: bssl::CryptoBufferPoolHandle* bssl::New<bssl::CryptoBufferPoolHandle, bssl::CryptoBufferPool*>(bssl::CryptoBufferPool*&&) bssl::CryptoBuffer* bssl::New<bssl::CryptoBuffer>() Line | Count | Source | 55 | 340k | T *New(Args &&...args) { | 56 | 340k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 340k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 340k | return new (t) T(std::forward<Args>(args)...); | 61 | 340k | } |
stack_st* bssl::New<stack_st>() Line | Count | Source | 55 | 1.10M | T *New(Args &&...args) { | 56 | 1.10M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.10M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.10M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.10M | } |
Unexecuted instantiation: x509_lookup_st* bssl::New<x509_lookup_st>() bssl::X509Store* bssl::New<bssl::X509Store>() Line | Count | Source | 55 | 5.14k | T *New(Args &&...args) { | 56 | 5.14k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.14k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.14k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.14k | } |
Unexecuted instantiation: x509_object_st* bssl::New<x509_object_st>() x509_store_ctx_st* bssl::New<x509_store_ctx_st>() Line | Count | Source | 55 | 8.16k | T *New(Args &&...args) { | 56 | 8.16k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 8.16k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 8.16k | return new (t) T(std::forward<Args>(args)...); | 61 | 8.16k | } |
X509_VERIFY_PARAM_st* bssl::New<X509_VERIFY_PARAM_st>() Line | Count | Source | 55 | 136k | T *New(Args &&...args) { | 56 | 136k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 136k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 136k | return new (t) T(std::forward<Args>(args)...); | 61 | 136k | } |
Unexecuted instantiation: X509_algor_st* bssl::New<X509_algor_st>() bssl::X509NameEntry* bssl::New<bssl::X509NameEntry>() Line | Count | Source | 55 | 739k | T *New(Args &&...args) { | 56 | 739k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 739k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 739k | return new (t) T(std::forward<Args>(args)...); | 61 | 739k | } |
bssl::X509Name* bssl::New<bssl::X509Name>() Line | Count | Source | 55 | 6.14k | T *New(Args &&...args) { | 56 | 6.14k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6.14k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6.14k | return new (t) T(std::forward<Args>(args)...); | 61 | 6.14k | } |
bssl::X509NameCache* bssl::New<bssl::X509NameCache>() Line | Count | Source | 55 | 365k | T *New(Args &&...args) { | 56 | 365k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 365k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 365k | return new (t) T(std::forward<Args>(args)...); | 61 | 365k | } |
Unexecuted instantiation: bssl::X509Pubkey* bssl::New<bssl::X509Pubkey>() bssl::X509Impl* bssl::New<bssl::X509Impl>() Line | Count | Source | 55 | 189k | T *New(Args &&...args) { | 56 | 189k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 189k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 189k | return new (t) T(std::forward<Args>(args)...); | 61 | 189k | } |
asn1_object_st* bssl::New<asn1_object_st>() Line | Count | Source | 55 | 1.89M | T *New(Args &&...args) { | 56 | 1.89M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.89M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.89M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.89M | } |
Unexecuted instantiation: bssl::ASN1_STRING_TABLE* bssl::New<bssl::ASN1_STRING_TABLE>() asn1_type_st* bssl::New<asn1_type_st>() Line | Count | Source | 55 | 417k | T *New(Args &&...args) { | 56 | 417k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 417k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 417k | return new (t) T(std::forward<Args>(args)...); | 61 | 417k | } |
asn1_string_st* bssl::New<asn1_string_st>() Line | Count | Source | 55 | 725k | T *New(Args &&...args) { | 56 | 725k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 725k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 725k | return new (t) T(std::forward<Args>(args)...); | 61 | 725k | } |
Unexecuted instantiation: evp_encode_ctx_st* bssl::New<evp_encode_ctx_st>() bssl::DSAImpl* bssl::New<bssl::DSAImpl>() Line | Count | Source | 55 | 6.35k | T *New(Args &&...args) { | 56 | 6.35k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6.35k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6.35k | return new (t) T(std::forward<Args>(args)...); | 61 | 6.35k | } |
Unexecuted instantiation: DSA_SIG_st* bssl::New<DSA_SIG_st>() Unexecuted instantiation: pkcs12_st* bssl::New<pkcs12_st>() Unexecuted instantiation: bssl::ByDir* bssl::New<bssl::ByDir>() Unexecuted instantiation: bssl::ByDirEntry* bssl::New<bssl::ByDirEntry>() Unexecuted instantiation: bssl::conf_section_st* bssl::New<bssl::conf_section_st>() Unexecuted instantiation: conf_st* bssl::New<conf_st>() conf_value_st* bssl::New<conf_value_st>() Line | Count | Source | 55 | 21.8k | T *New(Args &&...args) { | 56 | 21.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 21.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 21.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 21.8k | } |
Unexecuted instantiation: X509_info_st* bssl::New<X509_info_st>() Unexecuted instantiation: private_key_st* bssl::New<private_key_st>() Unexecuted instantiation: PKCS7* bssl::New<PKCS7>() Unexecuted instantiation: PKCS7_SIGNED* bssl::New<PKCS7_SIGNED>() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>* bssl::New<bssl::Vector<v3_ext_method const*>>() Unexecuted instantiation: v3_ext_method* bssl::New<v3_ext_method>() bssl::DTLSReadEpoch* bssl::New<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 55 | 32.4k | T *New(Args &&...args) { | 56 | 32.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 32.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 32.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 32.4k | } |
bssl::DTLSWriteEpoch* bssl::New<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 55 | 8.12k | T *New(Args &&...args) { | 56 | 8.12k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 8.12k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 8.12k | return new (t) T(std::forward<Args>(args)...); | 61 | 8.12k | } |
|
62 | | |
63 | | // Delete behaves like `delete` but uses `OPENSSL_free` to release memory. |
64 | | // |
65 | | // Note: unlike `delete` this does not support non-public destructors. |
66 | | template <typename T> |
67 | 9.08M | void Delete(T *t) { |
68 | 9.08M | if (t != nullptr) { |
69 | 8.63M | t->~T(); |
70 | 8.63M | OPENSSL_free(t); |
71 | 8.63M | } |
72 | 9.08M | } Unexecuted instantiation: void bssl::Delete<bssl::ECHConfig>(bssl::ECHConfig*) void bssl::Delete<bssl::ECHServerConfig>(bssl::ECHServerConfig*) Line | Count | Source | 67 | 12.1k | void Delete(T *t) { | 68 | 12.1k | if (t != nullptr) { | 69 | 12.1k | t->~T(); | 70 | 12.1k | OPENSSL_free(t); | 71 | 12.1k | } | 72 | 12.1k | } |
void bssl::Delete<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >*) Line | Count | Source | 67 | 363 | void Delete(T *t) { | 68 | 363 | if (t != nullptr) { | 69 | 363 | t->~T(); | 70 | 363 | OPENSSL_free(t); | 71 | 363 | } | 72 | 363 | } |
void bssl::Delete<bssl::SSLPAKEShare>(bssl::SSLPAKEShare*) Line | Count | Source | 67 | 46 | void Delete(T *t) { | 68 | 46 | if (t != nullptr) { | 69 | 46 | t->~T(); | 70 | 46 | OPENSSL_free(t); | 71 | 46 | } | 72 | 46 | } |
void bssl::Delete<bssl::SSLKeyShare>(bssl::SSLKeyShare*) Line | Count | Source | 67 | 149k | void Delete(T *t) { | 68 | 149k | if (t != nullptr) { | 69 | 149k | t->~T(); | 70 | 149k | OPENSSL_free(t); | 71 | 149k | } | 72 | 149k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Prover>(bssl::spake2plus::Prover*) void bssl::Delete<bssl::SSLCipherPreferenceList>(bssl::SSLCipherPreferenceList*) Line | Count | Source | 67 | 20.0k | void Delete(T *t) { | 68 | 20.0k | if (t != nullptr) { | 69 | 20.0k | t->~T(); | 70 | 20.0k | OPENSSL_free(t); | 71 | 20.0k | } | 72 | 20.0k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE>(bssl::SSL_HANDSHAKE*) Line | Count | Source | 67 | 155k | void Delete(T *t) { | 68 | 155k | if (t != nullptr) { | 69 | 155k | t->~T(); | 70 | 155k | OPENSSL_free(t); | 71 | 155k | } | 72 | 155k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE_HINTS>(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 67 | 77.8k | void Delete(T *t) { | 68 | 77.8k | if (t != nullptr) { | 69 | 77.8k | t->~T(); | 70 | 77.8k | OPENSSL_free(t); | 71 | 77.8k | } | 72 | 77.8k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Verifier>(bssl::spake2plus::Verifier*) void bssl::Delete<bssl::SSLAEADContext>(bssl::SSLAEADContext*) Line | Count | Source | 67 | 367k | void Delete(T *t) { | 68 | 367k | if (t != nullptr) { | 69 | 367k | t->~T(); | 70 | 367k | OPENSSL_free(t); | 71 | 367k | } | 72 | 367k | } |
void bssl::Delete<bssl::CERT>(bssl::CERT*) Line | Count | Source | 67 | 122k | void Delete(T *t) { | 68 | 122k | if (t != nullptr) { | 69 | 122k | t->~T(); | 70 | 122k | OPENSSL_free(t); | 71 | 122k | } | 72 | 122k | } |
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 | 67 | 117k | void Delete(T *t) { | 68 | 117k | if (t != nullptr) { | 69 | 117k | t->~T(); | 70 | 117k | OPENSSL_free(t); | 71 | 117k | } | 72 | 117k | } |
void bssl::Delete<ssl_st>(ssl_st*) Line | Count | Source | 67 | 117k | void Delete(T *t) { | 68 | 117k | if (t != nullptr) { | 69 | 117k | t->~T(); | 70 | 117k | OPENSSL_free(t); | 71 | 117k | } | 72 | 117k | } |
void bssl::Delete<bssl::TicketKey>(bssl::TicketKey*) Line | Count | Source | 67 | 410 | void Delete(T *t) { | 68 | 410 | if (t != nullptr) { | 69 | 410 | t->~T(); | 70 | 410 | OPENSSL_free(t); | 71 | 410 | } | 72 | 410 | } |
void bssl::Delete<bssl::RecordNumberEncrypter>(bssl::RecordNumberEncrypter*) Line | Count | Source | 67 | 40.0k | void Delete(T *t) { | 68 | 40.0k | if (t != nullptr) { | 69 | 40.0k | t->~T(); | 70 | 40.0k | OPENSSL_free(t); | 71 | 40.0k | } | 72 | 40.0k | } |
Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::NullRecordNumberEncrypter>(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) void bssl::Delete<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul> >(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 67 | 10.7k | void Delete(T *t) { | 68 | 10.7k | if (t != nullptr) { | 69 | 10.7k | t->~T(); | 70 | 10.7k | OPENSSL_free(t); | 71 | 10.7k | } | 72 | 10.7k | } |
void bssl::Delete<bssl::DTLSIncomingMessage>(bssl::DTLSIncomingMessage*) Line | Count | Source | 67 | 48.1k | void Delete(T *t) { | 68 | 48.1k | if (t != nullptr) { | 69 | 48.1k | t->~T(); | 70 | 48.1k | OPENSSL_free(t); | 71 | 48.1k | } | 72 | 48.1k | } |
void bssl::Delete<bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch*) Line | Count | Source | 67 | 8.12k | void Delete(T *t) { | 68 | 8.12k | if (t != nullptr) { | 69 | 8.12k | t->~T(); | 70 | 8.12k | OPENSSL_free(t); | 71 | 8.12k | } | 72 | 8.12k | } |
void bssl::Delete<bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch*) Line | Count | Source | 67 | 32.4k | void Delete(T *t) { | 68 | 32.4k | if (t != nullptr) { | 69 | 32.4k | t->~T(); | 70 | 32.4k | OPENSSL_free(t); | 71 | 32.4k | } | 72 | 32.4k | } |
void bssl::Delete<bssl::DTLSPrevReadEpoch>(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 67 | 30.0k | void Delete(T *t) { | 68 | 30.0k | if (t != nullptr) { | 69 | 30.0k | t->~T(); | 70 | 30.0k | OPENSSL_free(t); | 71 | 30.0k | } | 72 | 30.0k | } |
void bssl::Delete<bssl::DTLS1_STATE>(bssl::DTLS1_STATE*) Line | Count | Source | 67 | 40.6k | void Delete(T *t) { | 68 | 40.6k | if (t != nullptr) { | 69 | 40.6k | t->~T(); | 70 | 40.6k | OPENSSL_free(t); | 71 | 40.6k | } | 72 | 40.6k | } |
void bssl::Delete<bssl::SSL3_STATE>(bssl::SSL3_STATE*) Line | Count | Source | 67 | 117k | void Delete(T *t) { | 68 | 117k | if (t != nullptr) { | 69 | 117k | t->~T(); | 70 | 117k | OPENSSL_free(t); | 71 | 117k | } | 72 | 117k | } |
void bssl::Delete<ec_point_st>(ec_point_st*) Line | Count | Source | 67 | 150k | void Delete(T *t) { | 68 | 150k | if (t != nullptr) { | 69 | 150k | t->~T(); | 70 | 150k | OPENSSL_free(t); | 71 | 150k | } | 72 | 150k | } |
void bssl::Delete<bssl::EC_WRAPPED_SCALAR>(bssl::EC_WRAPPED_SCALAR*) Line | Count | Source | 67 | 63.7k | void Delete(T *t) { | 68 | 63.7k | if (t != nullptr) { | 69 | 3.66k | t->~T(); | 70 | 3.66k | OPENSSL_free(t); | 71 | 3.66k | } | 72 | 63.7k | } |
bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values*) Line | Count | Source | 67 | 406 | void Delete(T *t) { | 68 | 406 | if (t != nullptr) { | 69 | 406 | t->~T(); | 70 | 406 | OPENSSL_free(t); | 71 | 406 | } | 72 | 406 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>(mldsa::(anonymous namespace)::fips::keygen_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>(mldsa::(anonymous namespace)::fips::sign_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>(mldsa::(anonymous namespace)::fips::verify_self_test()::Values*) void bssl::Delete<bignum_st>(bignum_st*) Line | Count | Source | 67 | 723k | void Delete(T *t) { | 68 | 723k | if (t != nullptr) { | 69 | 723k | t->~T(); | 70 | 723k | OPENSSL_free(t); | 71 | 723k | } | 72 | 723k | } |
void bssl::Delete<bssl::BignumCtx>(bssl::BignumCtx*) Line | Count | Source | 67 | 76.9k | void Delete(T *t) { | 68 | 76.9k | if (t != nullptr) { | 69 | 76.9k | t->~T(); | 70 | 76.9k | OPENSSL_free(t); | 71 | 76.9k | } | 72 | 76.9k | } |
void bssl::Delete<bn_mont_ctx_st>(bn_mont_ctx_st*) Line | Count | Source | 67 | 24.5k | void Delete(T *t) { | 68 | 24.5k | if (t != nullptr) { | 69 | 24.5k | t->~T(); | 70 | 24.5k | OPENSSL_free(t); | 71 | 24.5k | } | 72 | 24.5k | } |
Unexecuted instantiation: void bssl::Delete<bn_gencb_st>(bn_gencb_st*) Unexecuted instantiation: void bssl::Delete<evp_aead_ctx_st>(evp_aead_ctx_st*) Unexecuted instantiation: void bssl::Delete<evp_cipher_ctx_st>(evp_cipher_ctx_st*) Unexecuted instantiation: void bssl::Delete<cmac_ctx_st>(cmac_ctx_st*) Unexecuted instantiation: void bssl::Delete<env_md_ctx_st>(env_md_ctx_st*) void bssl::Delete<hmac_ctx_st>(hmac_ctx_st*) Line | Count | Source | 67 | 32.3k | void Delete(T *t) { | 68 | 32.3k | if (t != nullptr) { | 69 | 32.3k | t->~T(); | 70 | 32.3k | OPENSSL_free(t); | 71 | 32.3k | } | 72 | 32.3k | } |
bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values*) Line | Count | Source | 67 | 417 | void Delete(T *t) { | 68 | 417 | if (t != nullptr) { | 69 | 417 | t->~T(); | 70 | 417 | OPENSSL_free(t); | 71 | 417 | } | 72 | 417 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values*) bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>(mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values*) Line | Count | Source | 67 | 248 | void Delete(T *t) { | 68 | 248 | if (t != nullptr) { | 69 | 248 | t->~T(); | 70 | 248 | OPENSSL_free(t); | 71 | 248 | } | 72 | 248 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: void bssl::Delete<ctr_drbg_state_st>(ctr_drbg_state_st*) Unexecuted instantiation: bcm.cc:void bssl::Delete<(anonymous namespace)::rand_thread_state>((anonymous namespace)::rand_thread_state*) Unexecuted instantiation: void bssl::Delete<bio_method_st>(bio_method_st*) void bssl::Delete<buf_mem_st>(buf_mem_st*) Line | Count | Source | 67 | 474k | void Delete(T *t) { | 68 | 474k | if (t != nullptr) { | 69 | 474k | t->~T(); | 70 | 474k | OPENSSL_free(t); | 71 | 474k | } | 72 | 474k | } |
void bssl::Delete<ecdsa_sig_st>(ecdsa_sig_st*) Line | Count | Source | 67 | 19.7k | void Delete(T *t) { | 68 | 19.7k | if (t != nullptr) { | 69 | 19.7k | t->~T(); | 70 | 19.7k | OPENSSL_free(t); | 71 | 19.7k | } | 72 | 19.7k | } |
Unexecuted instantiation: void bssl::Delete<engine_st>(engine_st*) void bssl::Delete<bssl::EvpPkeyCtx>(bssl::EvpPkeyCtx*) Line | Count | Source | 67 | 124k | void Delete(T *t) { | 68 | 124k | if (t != nullptr) { | 69 | 124k | t->~T(); | 70 | 124k | OPENSSL_free(t); | 71 | 124k | } | 72 | 124k | } |
Unexecuted instantiation: p_dh.cc:void bssl::Delete<(anonymous namespace)::DH_PKEY_CTX>((anonymous namespace)::DH_PKEY_CTX*) p_ec.cc:void bssl::Delete<(anonymous namespace)::EC_PKEY_CTX>((anonymous namespace)::EC_PKEY_CTX*) Line | Count | Source | 67 | 35.1k | void Delete(T *t) { | 68 | 35.1k | if (t != nullptr) { | 69 | 35.1k | t->~T(); | 70 | 35.1k | OPENSSL_free(t); | 71 | 35.1k | } | 72 | 35.1k | } |
p_ed25519.cc:void bssl::Delete<(anonymous namespace)::ED25519_KEY>((anonymous namespace)::ED25519_KEY*) Line | Count | Source | 67 | 256 | void Delete(T *t) { | 68 | 256 | if (t != nullptr) { | 69 | 256 | t->~T(); | 70 | 256 | OPENSSL_free(t); | 71 | 256 | } | 72 | 256 | } |
Unexecuted instantiation: p_hkdf.cc:void bssl::Delete<(anonymous namespace)::HKDF_PKEY_CTX>((anonymous namespace)::HKDF_PKEY_CTX*) p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 67 | 264 | void Delete(T *t) { | 68 | 264 | if (t != nullptr) { | 69 | 264 | t->~T(); | 70 | 264 | OPENSSL_free(t); | 71 | 264 | } | 72 | 264 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 67 | 30 | void Delete(T *t) { | 68 | 30 | if (t != nullptr) { | 69 | 30 | t->~T(); | 70 | 30 | OPENSSL_free(t); | 71 | 30 | } | 72 | 30 | } |
Unexecuted instantiation: p_mldsa.cc:void bssl::Delete<(anonymous namespace)::MldsaPkeyCtx>((anonymous namespace)::MldsaPkeyCtx*) p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 426 | void Delete(T *t) { | 68 | 426 | if (t != nullptr) { | 69 | 426 | t->~T(); | 70 | 426 | OPENSSL_free(t); | 71 | 426 | } | 72 | 426 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 11 | void Delete(T *t) { | 68 | 11 | if (t != nullptr) { | 69 | 11 | t->~T(); | 70 | 11 | OPENSSL_free(t); | 71 | 11 | } | 72 | 11 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 439 | void Delete(T *t) { | 68 | 439 | if (t != nullptr) { | 69 | 439 | t->~T(); | 70 | 439 | OPENSSL_free(t); | 71 | 439 | } | 72 | 439 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 22 | void Delete(T *t) { | 68 | 22 | if (t != nullptr) { | 69 | 22 | t->~T(); | 70 | 22 | OPENSSL_free(t); | 71 | 22 | } | 72 | 22 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 70 | void Delete(T *t) { | 68 | 70 | if (t != nullptr) { | 69 | 70 | t->~T(); | 70 | 70 | OPENSSL_free(t); | 71 | 70 | } | 72 | 70 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 137 | void Delete(T *t) { | 68 | 137 | if (t != nullptr) { | 69 | 137 | t->~T(); | 70 | 137 | OPENSSL_free(t); | 71 | 137 | } | 72 | 137 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 84 | void Delete(T *t) { | 68 | 84 | if (t != nullptr) { | 69 | 84 | t->~T(); | 70 | 84 | OPENSSL_free(t); | 71 | 84 | } | 72 | 84 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 165 | void Delete(T *t) { | 68 | 165 | if (t != nullptr) { | 69 | 165 | t->~T(); | 70 | 165 | OPENSSL_free(t); | 71 | 165 | } | 72 | 165 | } |
p_rsa.cc:void bssl::Delete<(anonymous namespace)::RSA_PKEY_CTX>((anonymous namespace)::RSA_PKEY_CTX*) Line | Count | Source | 67 | 89.4k | void Delete(T *t) { | 68 | 89.4k | if (t != nullptr) { | 69 | 89.4k | t->~T(); | 70 | 89.4k | OPENSSL_free(t); | 71 | 89.4k | } | 72 | 89.4k | } |
Unexecuted instantiation: void bssl::Delete<evp_hpke_key_st>(evp_hpke_key_st*) Unexecuted instantiation: void bssl::Delete<evp_hpke_ctx_st>(evp_hpke_ctx_st*) void bssl::Delete<bssl::_LHASH>(bssl::_LHASH*) Line | Count | Source | 67 | 5.12k | void Delete(T *t) { | 68 | 5.12k | if (t != nullptr) { | 69 | 5.12k | t->~T(); | 70 | 5.12k | OPENSSL_free(t); | 71 | 5.12k | } | 72 | 5.12k | } |
void bssl::Delete<bssl::LHASH_ITEM>(bssl::LHASH_ITEM*) Line | Count | Source | 67 | 11.3k | void Delete(T *t) { | 68 | 11.3k | if (t != nullptr) { | 69 | 11.3k | t->~T(); | 70 | 11.3k | OPENSSL_free(t); | 71 | 11.3k | } | 72 | 11.3k | } |
void bssl::Delete<stack_st>(stack_st*) Line | Count | Source | 67 | 1.10M | void Delete(T *t) { | 68 | 1.10M | if (t != nullptr) { | 69 | 1.10M | t->~T(); | 70 | 1.10M | OPENSSL_free(t); | 71 | 1.10M | } | 72 | 1.10M | } |
Unexecuted instantiation: void bssl::Delete<x509_lookup_st>(x509_lookup_st*) Unexecuted instantiation: void bssl::Delete<x509_object_st>(x509_object_st*) void bssl::Delete<x509_store_ctx_st>(x509_store_ctx_st*) Line | Count | Source | 67 | 8.16k | void Delete(T *t) { | 68 | 8.16k | if (t != nullptr) { | 69 | 8.16k | t->~T(); | 70 | 8.16k | OPENSSL_free(t); | 71 | 8.16k | } | 72 | 8.16k | } |
void bssl::Delete<X509_VERIFY_PARAM_st>(X509_VERIFY_PARAM_st*) Line | Count | Source | 67 | 136k | void Delete(T *t) { | 68 | 136k | if (t != nullptr) { | 69 | 136k | t->~T(); | 70 | 136k | OPENSSL_free(t); | 71 | 136k | } | 72 | 136k | } |
void bssl::Delete<bssl::X509NameEntry>(bssl::X509NameEntry*) Line | Count | Source | 67 | 739k | void Delete(T *t) { | 68 | 739k | if (t != nullptr) { | 69 | 739k | t->~T(); | 70 | 739k | OPENSSL_free(t); | 71 | 739k | } | 72 | 739k | } |
void bssl::Delete<bssl::X509NameCache>(bssl::X509NameCache*) Line | Count | Source | 67 | 751k | void Delete(T *t) { | 68 | 751k | if (t != nullptr) { | 69 | 365k | t->~T(); | 70 | 365k | OPENSSL_free(t); | 71 | 365k | } | 72 | 751k | } |
void bssl::Delete<bssl::X509Name>(bssl::X509Name*) Line | Count | Source | 67 | 11.8k | void Delete(T *t) { | 68 | 11.8k | if (t != nullptr) { | 69 | 6.14k | t->~T(); | 70 | 6.14k | OPENSSL_free(t); | 71 | 6.14k | } | 72 | 11.8k | } |
Unexecuted instantiation: void bssl::Delete<bssl::X509Pubkey>(bssl::X509Pubkey*) void bssl::Delete<asn1_object_st>(asn1_object_st*) Line | Count | Source | 67 | 1.89M | void Delete(T *t) { | 68 | 1.89M | if (t != nullptr) { | 69 | 1.89M | t->~T(); | 70 | 1.89M | OPENSSL_free(t); | 71 | 1.89M | } | 72 | 1.89M | } |
Unexecuted instantiation: void bssl::Delete<bssl::ASN1_STRING_TABLE>(bssl::ASN1_STRING_TABLE*) void bssl::Delete<asn1_type_st>(asn1_type_st*) Line | Count | Source | 67 | 417k | void Delete(T *t) { | 68 | 417k | if (t != nullptr) { | 69 | 417k | t->~T(); | 70 | 417k | OPENSSL_free(t); | 71 | 417k | } | 72 | 417k | } |
void bssl::Delete<asn1_string_st>(asn1_string_st*) Line | Count | Source | 67 | 725k | void Delete(T *t) { | 68 | 725k | if (t != nullptr) { | 69 | 725k | t->~T(); | 70 | 725k | OPENSSL_free(t); | 71 | 725k | } | 72 | 725k | } |
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*) Unexecuted instantiation: void bssl::Delete<bssl::ByDir>(bssl::ByDir*) Unexecuted instantiation: void bssl::Delete<bssl::ByDirEntry>(bssl::ByDirEntry*) Unexecuted instantiation: void bssl::Delete<bssl::conf_section_st>(bssl::conf_section_st*) Unexecuted instantiation: void bssl::Delete<conf_value_st>(conf_value_st*) Unexecuted instantiation: void bssl::Delete<conf_st>(conf_st*) Unexecuted instantiation: void bssl::Delete<char>(char*) Unexecuted instantiation: void bssl::Delete<private_key_st>(private_key_st*) Unexecuted instantiation: void bssl::Delete<X509_info_st>(X509_info_st*) Unexecuted instantiation: void bssl::Delete<PKCS7_SIGNED>(PKCS7_SIGNED*) Unexecuted instantiation: void bssl::Delete<PKCS7>(PKCS7*) Unexecuted instantiation: void bssl::Delete<v3_ext_method>(v3_ext_method*) |
73 | | |
74 | | namespace internal { |
75 | | |
76 | | // All types with kAllowUniquePtr set may be used with UniquePtr. Other types |
77 | | // may be C structs which require a `BORINGSSL_MAKE_DELETER` registration. Where |
78 | | // an internal type cannot be annotated (e.g. an alias of std::variant), use |
79 | | // `BORINGSSL_MAKE_DELETER(T, Delete)`. |
80 | | template <typename T> |
81 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowUniquePtr>> { |
82 | 1.19M | static void Free(T *t) { Delete(t); }Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ECHConfig, void>::Free(bssl::ECHConfig*) bssl::internal::DeleterImpl<bssl::ECHServerConfig, void>::Free(bssl::ECHServerConfig*) Line | Count | Source | 82 | 12.1k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLPAKEShare, void>::Free(bssl::SSLPAKEShare*) Line | Count | Source | 82 | 46 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLKeyShare, void>::Free(bssl::SSLKeyShare*) Line | Count | Source | 82 | 149k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::spake2plus::Prover, void>::Free(bssl::spake2plus::Prover*) bssl::internal::DeleterImpl<bssl::SSLCipherPreferenceList, void>::Free(bssl::SSLCipherPreferenceList*) Line | Count | Source | 82 | 20.0k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE, void>::Free(bssl::SSL_HANDSHAKE*) Line | Count | Source | 82 | 155k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE_HINTS, void>::Free(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 82 | 77.8k | 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 | 82 | 367k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::CERT, void>::Free(bssl::CERT*) Line | Count | Source | 82 | 122k | 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 | 82 | 117k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::TicketKey, void>::Free(bssl::TicketKey*) Line | Count | Source | 82 | 410 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::RecordNumberEncrypter, void>::Free(bssl::RecordNumberEncrypter*) Line | Count | Source | 82 | 40.0k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::NullRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) bssl::internal::DeleterImpl<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, void>::Free(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 82 | 10.7k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSIncomingMessage, void>::Free(bssl::DTLSIncomingMessage*) Line | Count | Source | 82 | 48.1k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSWriteEpoch, void>::Free(bssl::DTLSWriteEpoch*) Line | Count | Source | 82 | 8.12k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSReadEpoch, void>::Free(bssl::DTLSReadEpoch*) Line | Count | Source | 82 | 32.4k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSPrevReadEpoch, void>::Free(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 82 | 30.0k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::DTLS1_STATE, void>::Free(bssl::DTLS1_STATE*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::SSL3_STATE, void>::Free(bssl::SSL3_STATE*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values*) Line | Count | Source | 82 | 406 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::keygen_self_test()::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::sign_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::sign_self_test()::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::fips::verify_self_test()::Values, void>::Free(mldsa::(anonymous namespace)::fips::verify_self_test()::Values*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values*) Line | Count | Source | 82 | 417 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values*) bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values*) Line | Count | Source | 82 | 248 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:bssl::internal::DeleterImpl<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values, void>::Free(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::EvpPkeyCtx, void>::Free(bssl::EvpPkeyCtx*) p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 82 | 16 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 82 | 23 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 82 | 20 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 82 | 10 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 82 | 22 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 82 | 21 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 82 | 33 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 82 | 130 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 82 | 31 | static void Free(T *t) { Delete(t); } |
p_mlkem.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 82 | 130 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::X509NameEntry, void>::Free(bssl::X509NameEntry*) Line | Count | Source | 82 | 1.39k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509NameCache, void>::Free(bssl::X509NameCache*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ByDirEntry, void>::Free(bssl::ByDirEntry*) |
83 | | }; |
84 | | |
85 | | // All types with kAllowRefCountedUniquePtr may be used with UniquePtr, which |
86 | | // then will behave like std::shared_ptr. |
87 | | template <typename T> |
88 | | struct DeleterImpl<T, std::enable_if_t<T::kAllowRefCountedUniquePtr>> { |
89 | 737k | static void Free(T *t) { t->DecRefInternal(); }bssl::internal::DeleterImpl<bssl::SSLECHKeys, void>::Free(bssl::SSLECHKeys*) Line | Count | Source | 89 | 447 | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLCredential, void>::Free(bssl::SSLCredential*) Line | Count | Source | 89 | 264k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLContext, void>::Free(bssl::SSLContext*) Line | Count | Source | 89 | 235k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::RSAImpl, void>::Free(bssl::RSAImpl*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ECCustomGroup, void>::Free(bssl::ECCustomGroup*) bssl::internal::DeleterImpl<bssl::ECKey, void>::Free(bssl::ECKey*) Line | Count | Source | 89 | 2.83k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::Bio, void>::Free(bssl::Bio*) bssl::internal::DeleterImpl<bssl::EvpPkey, void>::Free(bssl::EvpPkey*) Line | Count | Source | 89 | 214k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::DSAImpl, void>::Free(bssl::DSAImpl*) Line | Count | Source | 89 | 5.43k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPoolHandle, void>::Free(bssl::CryptoBufferPoolHandle*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPool, void>::Free(bssl::CryptoBufferPool*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBuffer, void>::Free(bssl::CryptoBuffer*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509Store, void>::Free(bssl::X509Store*) bssl::internal::DeleterImpl<bssl::X509Impl, void>::Free(bssl::X509Impl*) Line | Count | Source | 89 | 13.7k | static void Free(T *t) { t->DecRefInternal(); } |
|
90 | | }; |
91 | | |
92 | | } // namespace internal |
93 | | |
94 | | // All types with kAllowRefCountedUniquePtr types also automatically get an |
95 | | // UpRef function. Other types may be C structs which require a |
96 | | // `BORINGSSL_MAKE_UP_REF` registration. |
97 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
98 | 446k | inline UniquePtr<T> UpRef(const T *v) { |
99 | 446k | if (v != nullptr) { |
100 | 384k | v->UpRefInternal(); |
101 | 384k | } |
102 | 446k | return UniquePtr<T>(const_cast<T *>(v)); |
103 | 446k | } std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> bssl::UpRef<bssl::SSLECHKeys, void>(bssl::SSLECHKeys const*) Line | Count | Source | 98 | 453 | inline UniquePtr<T> UpRef(const T *v) { | 99 | 453 | if (v != nullptr) { | 100 | 453 | v->UpRefInternal(); | 101 | 453 | } | 102 | 453 | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 453 | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::UpRef<bssl::SSLCredential, void>(bssl::SSLCredential const*) Line | Count | Source | 98 | 23.9k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 23.9k | if (v != nullptr) { | 100 | 23.9k | v->UpRefInternal(); | 101 | 23.9k | } | 102 | 23.9k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 23.9k | } |
std::__1::unique_ptr<bssl::SSLContext, bssl::internal::Deleter> bssl::UpRef<bssl::SSLContext, void>(bssl::SSLContext const*) Line | Count | Source | 98 | 235k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 235k | if (v != nullptr) { | 100 | 235k | v->UpRefInternal(); | 101 | 235k | } | 102 | 235k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 235k | } |
std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> bssl::UpRef<bssl::EvpPkey, void>(bssl::EvpPkey const*) Line | Count | Source | 98 | 186k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 186k | if (v != nullptr) { | 100 | 124k | v->UpRefInternal(); | 101 | 124k | } | 102 | 186k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 186k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBuffer, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBuffer, void>(bssl::CryptoBuffer const*) Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBufferPoolHandle, void>(bssl::CryptoBufferPoolHandle const*) |
104 | | template <typename T, typename = std::enable_if_t<T::kAllowRefCountedUniquePtr>> |
105 | 125k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { |
106 | 125k | return UpRef(ptr.get()); |
107 | 125k | } std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> bssl::UpRef<bssl::SSLECHKeys, void>(std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 447 | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 447 | return UpRef(ptr.get()); | 107 | 447 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::UpRef<bssl::SSLCredential, void>(std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> const&) std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> bssl::UpRef<bssl::EvpPkey, void>(std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 124k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 124k | return UpRef(ptr.get()); | 107 | 124k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::UpRef<bssl::CryptoBufferPoolHandle, void>(std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> const&) |
108 | | |
109 | | // MakeUnique behaves like `std::make_unique` but returns nullptr on allocation |
110 | | // error. |
111 | | template <typename T, typename... Args> |
112 | 3.51M | UniquePtr<T> MakeUnique(Args &&...args) { |
113 | 3.51M | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); |
114 | 3.51M | } Unexecuted instantiation: std::__1::unique_ptr<bssl::ECHConfig, bssl::internal::Deleter> bssl::MakeUnique<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> bssl::MakeUnique<bssl::ECHServerConfig>() Line | Count | Source | 112 | 12.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 12.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 12.1k | } |
std::__1::unique_ptr<bssl::SSLPAKEShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLPAKEShare>() Line | Count | Source | 112 | 46 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 46 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 46 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::spake2plus::Prover, bssl::internal::Deleter> bssl::MakeUnique<bssl::spake2plus::Prover>() std::__1::unique_ptr<bssl::SSLCipherPreferenceList, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCipherPreferenceList>() Line | Count | Source | 112 | 20.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 20.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 20.0k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE_HINTS, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 112 | 77.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 77.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 77.8k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE, ssl_st*&>(ssl_st*&) Line | Count | Source | 112 | 155k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 155k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 155k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 112 | 235k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 235k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 235k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 112 | 131k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 131k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 131k | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 112 | 122k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 122k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 122k | } |
std::__1::unique_ptr<bssl::CERT, bssl::internal::Deleter> bssl::MakeUnique<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ECKeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 112 | 17.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 17.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 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 | 112 | 80.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 80.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 80.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 | 112 | 277 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 277 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 277 | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::X25519MLKEM768KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 112 | 51.6k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 51.6k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 51.6k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::MLKEM1024KeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 112 | 30 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 30 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 30 | } |
std::__1::unique_ptr<bssl::SSLContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLContext, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 112 | 5.14k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 5.14k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 5.14k | } |
std::__1::unique_ptr<bssl::CERT, bssl::internal::Deleter> bssl::MakeUnique<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 112 | 5.14k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 5.14k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 5.14k | } |
std::__1::unique_ptr<ssl_st, bssl::internal::Deleter> bssl::MakeUnique<ssl_st, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
std::__1::unique_ptr<bssl::SSL_CONFIG, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_CONFIG, ssl_st*>(ssl_st*&&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
std::__1::unique_ptr<bssl::TicketKey, bssl::internal::Deleter> bssl::MakeUnique<bssl::TicketKey>() Line | Count | Source | 112 | 413 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 413 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 413 | } |
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 | 112 | 229k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 229k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 229k | } |
tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::NullRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 112 | 40.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 40.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 40.0k | } |
Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: std::__1::unique_ptr<bssl::spake2plus::Verifier, bssl::internal::Deleter> bssl::MakeUnique<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >(std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter>&&) Line | Count | Source | 112 | 363 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 363 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 363 | } |
std::__1::unique_ptr<bssl::DTLSIncomingMessage, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSIncomingMessage>() Line | Count | Source | 112 | 48.1k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 48.1k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 48.1k | } |
std::__1::unique_ptr<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, bssl::internal::Deleter> bssl::MakeUnique<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 112 | 10.7k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 10.7k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 10.7k | } |
std::__1::unique_ptr<bssl::DTLS1_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLS1_STATE>() Line | Count | Source | 112 | 40.6k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 40.6k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 40.6k | } |
std::__1::unique_ptr<bssl::DTLSPrevReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 112 | 30.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 30.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 30.0k | } |
std::__1::unique_ptr<bssl::SSL3_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL3_STATE>() Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>() Line | Count | Source | 112 | 406 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 406 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 406 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::sign_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::verify_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7>*)::Values>() Line | Count | Source | 112 | 417 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 417 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 417 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<8, 7>(unsigned char*, mldsa::(anonymous namespace)::private_key<8, 7> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<8, 7>(mldsa::(anonymous namespace)::public_key<8> const*, unsigned char const*, unsigned char const*)::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4>*)::Values>() Line | Count | Source | 112 | 248 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 248 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 248 | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>() Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>() std::__1::unique_ptr<bssl::EvpPkeyCtx, bssl::internal::Deleter> bssl::MakeUnique<bssl::EvpPkeyCtx>() Line | Count | Source | 112 | 124k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 124k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 124k | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 112 | 264 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 264 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 264 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 112 | 30 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 30 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 30 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 112 | 426 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 426 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 426 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 112 | 11 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 11 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 11 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 112 | 439 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 439 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 439 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 112 | 22 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 22 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 22 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 112 | 70 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 70 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 70 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 112 | 137 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 137 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 137 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 112 | 84 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 84 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 84 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 112 | 165 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 165 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 165 | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPool, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBufferPool>() Unexecuted instantiation: std::__1::unique_ptr<bssl::CryptoBufferPoolHandle, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBufferPoolHandle, bssl::CryptoBufferPool*>(bssl::CryptoBufferPool*&&) std::__1::unique_ptr<bssl::CryptoBuffer, bssl::internal::Deleter> bssl::MakeUnique<bssl::CryptoBuffer>() Line | Count | Source | 112 | 340k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 340k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 340k | } |
Unexecuted instantiation: std::__1::unique_ptr<X509_algor_st, bssl::internal::Deleter> bssl::MakeUnique<X509_algor_st>() std::__1::unique_ptr<bssl::X509NameEntry, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509NameEntry>() Line | Count | Source | 112 | 739k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 739k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 739k | } |
std::__1::unique_ptr<bssl::X509NameCache, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509NameCache>() Line | Count | Source | 112 | 365k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 365k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 365k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> bssl::MakeUnique<bssl::ByDirEntry>() std::__1::unique_ptr<bssl::DTLSReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 112 | 32.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 32.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 32.4k | } |
std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 112 | 8.12k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 8.12k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 8.12k | } |
|
115 | | |
116 | | |
117 | | // RefCounted is a common base for ref-counted types. This is an instance of the |
118 | | // C++ curiously-recurring template pattern, so a type Foo must subclass |
119 | | // RefCounted<Foo>. It additionally must friend RefCounted<Foo> to allow calling |
120 | | // the destructor. |
121 | | template <typename Derived> |
122 | | class RefCounted { |
123 | | public: |
124 | | static constexpr bool kAllowRefCountedUniquePtr = true; |
125 | | |
126 | | RefCounted(const RefCounted &) = delete; |
127 | | RefCounted &operator=(const RefCounted &) = delete; |
128 | | |
129 | | // These methods are intentionally named differently from `bssl::UpRef` to |
130 | | // avoid a collision. Only the implementations of `FOO_up_ref` and `FOO_free` |
131 | | // should call these. `DecRefInternal` returns true if the object was freed |
132 | | // and false if there are still references. |
133 | 1.05M | void UpRefInternal() const { |
134 | | // Safety: the following call does not mutate anything other than the atomic |
135 | | // ref-count variable. |
136 | 1.05M | CRYPTO_refcount_inc(&references_); |
137 | 1.05M | } bssl::RefCounted<bssl::SSLECHKeys>::UpRefInternal() const Line | Count | Source | 133 | 453 | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 453 | CRYPTO_refcount_inc(&references_); | 137 | 453 | } |
bssl::RefCounted<bssl::SSLCredential>::UpRefInternal() const Line | Count | Source | 133 | 23.9k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 23.9k | CRYPTO_refcount_inc(&references_); | 137 | 23.9k | } |
bssl::RefCounted<bssl::SSLContext>::UpRefInternal() const Line | Count | Source | 133 | 235k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 235k | CRYPTO_refcount_inc(&references_); | 137 | 235k | } |
bssl::RefCounted<ssl_session_st>::UpRefInternal() const Line | Count | Source | 133 | 107k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 107k | CRYPTO_refcount_inc(&references_); | 137 | 107k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::UpRefInternal() const bssl::RefCounted<bssl::RSAImpl>::UpRefInternal() const Line | Count | Source | 133 | 12 | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 12 | CRYPTO_refcount_inc(&references_); | 137 | 12 | } |
bssl::RefCounted<bssl::Bio>::UpRefInternal() const Line | Count | Source | 133 | 18 | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 18 | CRYPTO_refcount_inc(&references_); | 137 | 18 | } |
bssl::RefCounted<bssl::EvpPkey>::UpRefInternal() const Line | Count | Source | 133 | 471k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 471k | CRYPTO_refcount_inc(&references_); | 137 | 471k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::X509Store>::UpRefInternal() const bssl::RefCounted<bssl::X509Impl>::UpRefInternal() const Line | Count | Source | 133 | 212k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 212k | CRYPTO_refcount_inc(&references_); | 137 | 212k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::UpRefInternal() const |
138 | 2.26M | bool DecRefInternal() { |
139 | 2.26M | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { |
140 | 1.21M | Derived *d = static_cast<Derived *>(this); |
141 | 1.21M | d->~Derived(); |
142 | 1.21M | OPENSSL_free(d); |
143 | 1.21M | return true; |
144 | 1.21M | } |
145 | 1.05M | return false; |
146 | 2.26M | } bssl::RefCounted<bssl::SSLECHKeys>::DecRefInternal() Line | Count | Source | 138 | 15.2k | bool DecRefInternal() { | 139 | 15.2k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 14.8k | Derived *d = static_cast<Derived *>(this); | 141 | 14.8k | d->~Derived(); | 142 | 14.8k | OPENSSL_free(d); | 143 | 14.8k | return true; | 144 | 14.8k | } | 145 | 453 | return false; | 146 | 15.2k | } |
bssl::RefCounted<bssl::SSLCredential>::DecRefInternal() Line | Count | Source | 138 | 264k | bool DecRefInternal() { | 139 | 264k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 240k | Derived *d = static_cast<Derived *>(this); | 141 | 240k | d->~Derived(); | 142 | 240k | OPENSSL_free(d); | 143 | 240k | return true; | 144 | 240k | } | 145 | 23.9k | return false; | 146 | 264k | } |
bssl::RefCounted<bssl::SSLContext>::DecRefInternal() Line | Count | Source | 138 | 240k | bool DecRefInternal() { | 139 | 240k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 5.12k | Derived *d = static_cast<Derived *>(this); | 141 | 5.12k | d->~Derived(); | 142 | 5.12k | OPENSSL_free(d); | 143 | 5.12k | return true; | 144 | 5.12k | } | 145 | 235k | return false; | 146 | 240k | } |
bssl::RefCounted<ssl_session_st>::DecRefInternal() Line | Count | Source | 138 | 336k | bool DecRefInternal() { | 139 | 336k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 229k | Derived *d = static_cast<Derived *>(this); | 141 | 229k | d->~Derived(); | 142 | 229k | OPENSSL_free(d); | 143 | 229k | return true; | 144 | 229k | } | 145 | 107k | return false; | 146 | 336k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::DecRefInternal() bssl::RefCounted<bssl::ECKey>::DecRefInternal() Line | Count | Source | 138 | 60.0k | bool DecRefInternal() { | 139 | 60.0k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 60.0k | Derived *d = static_cast<Derived *>(this); | 141 | 60.0k | d->~Derived(); | 142 | 60.0k | OPENSSL_free(d); | 143 | 60.0k | return true; | 144 | 60.0k | } | 145 | 0 | return false; | 146 | 60.0k | } |
bssl::RefCounted<bssl::RSAImpl>::DecRefInternal() Line | Count | Source | 138 | 140k | bool DecRefInternal() { | 139 | 140k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 140k | Derived *d = static_cast<Derived *>(this); | 141 | 140k | d->~Derived(); | 142 | 140k | OPENSSL_free(d); | 143 | 140k | return true; | 144 | 140k | } | 145 | 12 | return false; | 146 | 140k | } |
bssl::RefCounted<bssl::Bio>::DecRefInternal() Line | Count | Source | 138 | 66.7k | bool DecRefInternal() { | 139 | 66.7k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 66.7k | Derived *d = static_cast<Derived *>(this); | 141 | 66.7k | d->~Derived(); | 142 | 66.7k | OPENSSL_free(d); | 143 | 66.7k | return true; | 144 | 66.7k | } | 145 | 18 | return false; | 146 | 66.7k | } |
bssl::RefCounted<bssl::EvpPkey>::DecRefInternal() Line | Count | Source | 138 | 725k | bool DecRefInternal() { | 139 | 725k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 254k | Derived *d = static_cast<Derived *>(this); | 141 | 254k | d->~Derived(); | 142 | 254k | OPENSSL_free(d); | 143 | 254k | return true; | 144 | 254k | } | 145 | 471k | return false; | 146 | 725k | } |
bssl::RefCounted<bssl::DSAImpl>::DecRefInternal() Line | Count | Source | 138 | 6.35k | bool DecRefInternal() { | 139 | 6.35k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 6.35k | Derived *d = static_cast<Derived *>(this); | 141 | 6.35k | d->~Derived(); | 142 | 6.35k | OPENSSL_free(d); | 143 | 6.35k | return true; | 144 | 6.35k | } | 145 | 0 | return false; | 146 | 6.35k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::DecRefInternal() bssl::RefCounted<bssl::X509Store>::DecRefInternal() Line | Count | Source | 138 | 5.12k | bool DecRefInternal() { | 139 | 5.12k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 5.12k | Derived *d = static_cast<Derived *>(this); | 141 | 5.12k | d->~Derived(); | 142 | 5.12k | OPENSSL_free(d); | 143 | 5.12k | return true; | 144 | 5.12k | } | 145 | 0 | return false; | 146 | 5.12k | } |
bssl::RefCounted<bssl::X509Impl>::DecRefInternal() Line | Count | Source | 138 | 401k | bool DecRefInternal() { | 139 | 401k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 140 | 189k | Derived *d = static_cast<Derived *>(this); | 141 | 189k | d->~Derived(); | 142 | 189k | OPENSSL_free(d); | 143 | 189k | return true; | 144 | 189k | } | 145 | 212k | return false; | 146 | 401k | } |
|
147 | | |
148 | | protected: |
149 | | // Ensure that only `Derived`, which must inherit from `RefCounted<Derived>`, |
150 | | // can call the constructor. This catches bugs where someone inherited from |
151 | | // the wrong base. |
152 | | class CheckSubClass { |
153 | | private: |
154 | | friend Derived; |
155 | | CheckSubClass() = default; |
156 | | }; |
157 | 1.21M | RefCounted(CheckSubClass) { |
158 | 1.21M | static_assert(std::is_base_of_v<RefCounted, Derived>, |
159 | 1.21M | "Derived must subclass RefCounted<Derived>"); |
160 | 1.21M | } bssl::RefCounted<bssl::SSLECHKeys>::RefCounted(bssl::RefCounted<bssl::SSLECHKeys>::CheckSubClass) Line | Count | Source | 157 | 14.8k | RefCounted(CheckSubClass) { | 158 | 14.8k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 14.8k | "Derived must subclass RefCounted<Derived>"); | 160 | 14.8k | } |
bssl::RefCounted<bssl::SSLCredential>::RefCounted(bssl::RefCounted<bssl::SSLCredential>::CheckSubClass) Line | Count | Source | 157 | 240k | RefCounted(CheckSubClass) { | 158 | 240k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 240k | "Derived must subclass RefCounted<Derived>"); | 160 | 240k | } |
bssl::RefCounted<bssl::SSLContext>::RefCounted(bssl::RefCounted<bssl::SSLContext>::CheckSubClass) Line | Count | Source | 157 | 5.14k | RefCounted(CheckSubClass) { | 158 | 5.14k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 5.14k | "Derived must subclass RefCounted<Derived>"); | 160 | 5.14k | } |
bssl::RefCounted<ssl_session_st>::RefCounted(bssl::RefCounted<ssl_session_st>::CheckSubClass) Line | Count | Source | 157 | 229k | RefCounted(CheckSubClass) { | 158 | 229k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 229k | "Derived must subclass RefCounted<Derived>"); | 160 | 229k | } |
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 | 157 | 60.0k | RefCounted(CheckSubClass) { | 158 | 60.0k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 60.0k | "Derived must subclass RefCounted<Derived>"); | 160 | 60.0k | } |
bssl::RefCounted<bssl::RSAImpl>::RefCounted(bssl::RefCounted<bssl::RSAImpl>::CheckSubClass) Line | Count | Source | 157 | 140k | RefCounted(CheckSubClass) { | 158 | 140k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 140k | "Derived must subclass RefCounted<Derived>"); | 160 | 140k | } |
bssl::RefCounted<bssl::Bio>::RefCounted(bssl::RefCounted<bssl::Bio>::CheckSubClass) Line | Count | Source | 157 | 66.7k | RefCounted(CheckSubClass) { | 158 | 66.7k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 66.7k | "Derived must subclass RefCounted<Derived>"); | 160 | 66.7k | } |
bssl::RefCounted<bssl::EvpPkey>::RefCounted(bssl::RefCounted<bssl::EvpPkey>::CheckSubClass) Line | Count | Source | 157 | 254k | RefCounted(CheckSubClass) { | 158 | 254k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 254k | "Derived must subclass RefCounted<Derived>"); | 160 | 254k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPool>::CheckSubClass) Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPoolHandle>::CheckSubClass) bssl::RefCounted<bssl::X509Store>::RefCounted(bssl::RefCounted<bssl::X509Store>::CheckSubClass) Line | Count | Source | 157 | 5.14k | RefCounted(CheckSubClass) { | 158 | 5.14k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 5.14k | "Derived must subclass RefCounted<Derived>"); | 160 | 5.14k | } |
bssl::RefCounted<bssl::X509Impl>::RefCounted(bssl::RefCounted<bssl::X509Impl>::CheckSubClass) Line | Count | Source | 157 | 189k | RefCounted(CheckSubClass) { | 158 | 189k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 189k | "Derived must subclass RefCounted<Derived>"); | 160 | 189k | } |
bssl::RefCounted<bssl::DSAImpl>::RefCounted(bssl::RefCounted<bssl::DSAImpl>::CheckSubClass) Line | Count | Source | 157 | 6.35k | RefCounted(CheckSubClass) { | 158 | 6.35k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 159 | 6.35k | "Derived must subclass RefCounted<Derived>"); | 160 | 6.35k | } |
|
161 | | |
162 | 1.21M | ~RefCounted() { BSSL_CHECK(references_.load() == 0); }bssl::RefCounted<bssl::SSLECHKeys>::~RefCounted() Line | Count | Source | 162 | 14.8k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLCredential>::~RefCounted() Line | Count | Source | 162 | 240k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLContext>::~RefCounted() Line | Count | Source | 162 | 5.12k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<ssl_session_st>::~RefCounted() Line | Count | Source | 162 | 229k | ~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 | 162 | 60.0k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::RSAImpl>::~RefCounted() Line | Count | Source | 162 | 140k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::Bio>::~RefCounted() Line | Count | Source | 162 | 66.7k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::EvpPkey>::~RefCounted() Line | Count | Source | 162 | 254k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::~RefCounted() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::~RefCounted() bssl::RefCounted<bssl::X509Store>::~RefCounted() Line | Count | Source | 162 | 5.12k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::X509Impl>::~RefCounted() Line | Count | Source | 162 | 189k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::DSAImpl>::~RefCounted() Line | Count | Source | 162 | 6.35k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
|
163 | | |
164 | | private: |
165 | | mutable CRYPTO_refcount_t references_ = 1; |
166 | | }; |
167 | | |
168 | | |
169 | | // Containers. |
170 | | |
171 | | // Array<T> is an owning array of elements of `T`. |
172 | | template <typename T> |
173 | | class Array { |
174 | | public: |
175 | | using value_type = std::remove_cv_t<T>; |
176 | | |
177 | | // Array's default constructor creates an empty array. |
178 | 10.5M | Array() {}bssl::Array<unsigned char>::Array() Line | Count | Source | 178 | 9.07M | Array() {} |
bssl::Array<unsigned short>::Array() Line | Count | Source | 178 | 1.26M | Array() {} |
Unexecuted instantiation: bssl::Array<unsigned long>::Array() bssl::Array<unsigned int>::Array() Line | Count | Source | 178 | 122k | Array() {} |
bssl::Array<bssl::SSLCredential*>::Array() Line | Count | Source | 178 | 24.3k | Array() {} |
bssl::Array<int>::Array() Line | Count | Source | 178 | 7.09k | Array() {} |
bssl::Array<bool>::Array() Line | Count | Source | 178 | 40.0k | Array() {} |
|
179 | | Array(const Array &) = delete; |
180 | 370k | Array(Array &&other) { *this = std::move(other); } |
181 | | |
182 | 10.9M | ~Array() { Reset(); }bssl::Array<unsigned char>::~Array() Line | Count | Source | 182 | 9.44M | ~Array() { Reset(); } |
bssl::Array<unsigned short>::~Array() Line | Count | Source | 182 | 1.26M | ~Array() { Reset(); } |
bssl::Array<unsigned int>::~Array() Line | Count | Source | 182 | 122k | ~Array() { Reset(); } |
Unexecuted instantiation: bssl::Array<unsigned long>::~Array() bssl::Array<bssl::SSLCredential*>::~Array() Line | Count | Source | 182 | 24.3k | ~Array() { Reset(); } |
bssl::Array<int>::~Array() Line | Count | Source | 182 | 7.09k | ~Array() { Reset(); } |
bssl::Array<bool>::~Array() Line | Count | Source | 182 | 40.0k | ~Array() { Reset(); } |
|
183 | | |
184 | | Array &operator=(const Array &) = delete; |
185 | 485k | Array &operator=(Array &&other) { |
186 | 485k | Reset(); |
187 | 485k | other.Release(&data_, &size_); |
188 | 485k | return *this; |
189 | 485k | } bssl::Array<unsigned char>::operator=(bssl::Array<unsigned char>&&) Line | Count | Source | 185 | 447k | Array &operator=(Array &&other) { | 186 | 447k | Reset(); | 187 | 447k | other.Release(&data_, &size_); | 188 | 447k | return *this; | 189 | 447k | } |
bssl::Array<unsigned short>::operator=(bssl::Array<unsigned short>&&) Line | Count | Source | 185 | 37.4k | Array &operator=(Array &&other) { | 186 | 37.4k | Reset(); | 187 | 37.4k | other.Release(&data_, &size_); | 188 | 37.4k | return *this; | 189 | 37.4k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::operator=(bssl::Array<unsigned int>&&) |
190 | | |
191 | 4.03M | const T *data() const { return data_; }bssl::Array<unsigned char>::data() const Line | Count | Source | 191 | 2.91M | const T *data() const { return data_; } |
bssl::Array<unsigned short>::data() const Line | Count | Source | 191 | 843k | const T *data() const { return data_; } |
bssl::Array<unsigned int>::data() const Line | Count | Source | 191 | 235k | const T *data() const { return data_; } |
bssl::Array<bool>::data() const Line | Count | Source | 191 | 40.0k | const T *data() const { return data_; } |
|
192 | 351k | T *data() { return data_; }bssl::Array<unsigned char>::data() Line | Count | Source | 192 | 346k | T *data() { return data_; } |
bssl::Array<unsigned short>::data() Line | Count | Source | 192 | 5.39k | T *data() { return data_; } |
|
193 | 9.08M | size_t size() const { return size_; }bssl::Array<unsigned char>::size() const Line | Count | Source | 193 | 6.81M | size_t size() const { return size_; } |
bssl::Array<unsigned short>::size() const Line | Count | Source | 193 | 1.99M | size_t size() const { return size_; } |
bssl::Array<unsigned int>::size() const Line | Count | Source | 193 | 235k | size_t size() const { return size_; } |
bssl::Array<bool>::size() const Line | Count | Source | 193 | 40.0k | size_t size() const { return size_; } |
|
194 | 2.87M | bool empty() const { return size_ == 0; }bssl::Array<unsigned char>::empty() const Line | Count | Source | 194 | 2.68M | bool empty() const { return size_ == 0; } |
bssl::Array<unsigned short>::empty() const Line | Count | Source | 194 | 175k | bool empty() const { return size_ == 0; } |
bssl::Array<bssl::SSLCredential*>::empty() const Line | Count | Source | 194 | 12.7k | bool empty() const { return size_ == 0; } |
|
195 | | |
196 | 2.04M | const T &operator[](size_t i) const { |
197 | 2.04M | BSSL_CHECK(i < size_); |
198 | 2.04M | return data_[i]; |
199 | 2.04M | } |
200 | 5.40M | T &operator[](size_t i) { |
201 | 5.40M | BSSL_CHECK(i < size_); |
202 | 5.40M | return data_[i]; |
203 | 5.40M | } bssl::Array<unsigned short>::operator[](unsigned long) Line | Count | Source | 200 | 2.23M | T &operator[](size_t i) { | 201 | 2.23M | BSSL_CHECK(i < size_); | 202 | 2.23M | return data_[i]; | 203 | 2.23M | } |
bssl::Array<unsigned char>::operator[](unsigned long) Line | Count | Source | 200 | 1.83M | T &operator[](size_t i) { | 201 | 1.83M | BSSL_CHECK(i < size_); | 202 | 1.83M | return data_[i]; | 203 | 1.83M | } |
Unexecuted instantiation: bssl::Array<unsigned long>::operator[](unsigned long) Unexecuted instantiation: bssl::Array<unsigned int>::operator[](unsigned long) bssl::Array<int>::operator[](unsigned long) Line | Count | Source | 200 | 1.16M | T &operator[](size_t i) { | 201 | 1.16M | BSSL_CHECK(i < size_); | 202 | 1.16M | return data_[i]; | 203 | 1.16M | } |
bssl::Array<bool>::operator[](unsigned long) Line | Count | Source | 200 | 149k | T &operator[](size_t i) { | 201 | 149k | BSSL_CHECK(i < size_); | 202 | 149k | return data_[i]; | 203 | 149k | } |
bssl::Array<bssl::SSLCredential*>::operator[](unsigned long) Line | Count | Source | 200 | 24.3k | T &operator[](size_t i) { | 201 | 24.3k | BSSL_CHECK(i < size_); | 202 | 24.3k | return data_[i]; | 203 | 24.3k | } |
|
204 | | |
205 | | T &front() { |
206 | | BSSL_CHECK(size_ != 0); |
207 | | return data_[0]; |
208 | | } |
209 | | const T &front() const { |
210 | | BSSL_CHECK(size_ != 0); |
211 | | return data_[0]; |
212 | | } |
213 | | T &back() { |
214 | | BSSL_CHECK(size_ != 0); |
215 | | return data_[size_ - 1]; |
216 | | } |
217 | | const T &back() const { |
218 | | BSSL_CHECK(size_ != 0); |
219 | | return data_[size_ - 1]; |
220 | | } |
221 | | |
222 | 269k | T *begin() { return data_; }bssl::Array<unsigned short>::begin() Line | Count | Source | 222 | 233k | T *begin() { return data_; } |
bssl::Array<bssl::SSLCredential*>::begin() Line | Count | Source | 222 | 24.3k | T *begin() { return data_; } |
bssl::Array<unsigned char>::begin() Line | Count | Source | 222 | 11.5k | T *begin() { return data_; } |
|
223 | 0 | const T *begin() const { return data_; } |
224 | 281k | T *end() { return data_ + size_; }bssl::Array<unsigned short>::end() Line | Count | Source | 224 | 233k | T *end() { return data_ + size_; } |
bssl::Array<bssl::SSLCredential*>::end() Line | Count | Source | 224 | 24.3k | T *end() { return data_ + size_; } |
bssl::Array<unsigned char>::end() Line | Count | Source | 224 | 23.1k | T *end() { return data_ + size_; } |
|
225 | 0 | const T *end() const { return data_ + size_; } |
226 | | |
227 | 14.0M | void Reset() { Reset(nullptr, 0); }bssl::Array<unsigned char>::Reset() Line | Count | Source | 227 | 11.7M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<unsigned short>::Reset() Line | Count | Source | 227 | 1.87M | void Reset() { Reset(nullptr, 0); } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset() bssl::Array<unsigned int>::Reset() Line | Count | Source | 227 | 252k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bssl::SSLCredential*>::Reset() Line | Count | Source | 227 | 48.7k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<int>::Reset() Line | Count | Source | 227 | 14.1k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bool>::Reset() Line | Count | Source | 227 | 80.1k | void Reset() { Reset(nullptr, 0); } |
|
228 | | |
229 | | // Reset releases the current contents of the array and takes ownership of the |
230 | | // raw pointer supplied by the caller. |
231 | 15.0M | void Reset(T *new_data, size_t new_size) { |
232 | 15.0M | std::destroy_n(data_, size_); |
233 | 15.0M | OPENSSL_free(data_); |
234 | 15.0M | data_ = new_data; |
235 | 15.0M | size_ = new_size; |
236 | 15.0M | } bssl::Array<unsigned char>::Reset(unsigned char*, unsigned long) Line | Count | Source | 231 | 12.7M | void Reset(T *new_data, size_t new_size) { | 232 | 12.7M | std::destroy_n(data_, size_); | 233 | 12.7M | OPENSSL_free(data_); | 234 | 12.7M | data_ = new_data; | 235 | 12.7M | size_ = new_size; | 236 | 12.7M | } |
bssl::Array<unsigned short>::Reset(unsigned short*, unsigned long) Line | Count | Source | 231 | 1.87M | void Reset(T *new_data, size_t new_size) { | 232 | 1.87M | std::destroy_n(data_, size_); | 233 | 1.87M | OPENSSL_free(data_); | 234 | 1.87M | data_ = new_data; | 235 | 1.87M | size_ = new_size; | 236 | 1.87M | } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset(unsigned long*, unsigned long) bssl::Array<unsigned int>::Reset(unsigned int*, unsigned long) Line | Count | Source | 231 | 252k | void Reset(T *new_data, size_t new_size) { | 232 | 252k | std::destroy_n(data_, size_); | 233 | 252k | OPENSSL_free(data_); | 234 | 252k | data_ = new_data; | 235 | 252k | size_ = new_size; | 236 | 252k | } |
bssl::Array<bssl::SSLCredential*>::Reset(bssl::SSLCredential**, unsigned long) Line | Count | Source | 231 | 48.7k | void Reset(T *new_data, size_t new_size) { | 232 | 48.7k | std::destroy_n(data_, size_); | 233 | 48.7k | OPENSSL_free(data_); | 234 | 48.7k | data_ = new_data; | 235 | 48.7k | size_ = new_size; | 236 | 48.7k | } |
bssl::Array<int>::Reset(int*, unsigned long) Line | Count | Source | 231 | 14.1k | void Reset(T *new_data, size_t new_size) { | 232 | 14.1k | std::destroy_n(data_, size_); | 233 | 14.1k | OPENSSL_free(data_); | 234 | 14.1k | data_ = new_data; | 235 | 14.1k | size_ = new_size; | 236 | 14.1k | } |
bssl::Array<bool>::Reset(bool*, unsigned long) Line | Count | Source | 231 | 80.1k | void Reset(T *new_data, size_t new_size) { | 232 | 80.1k | std::destroy_n(data_, size_); | 233 | 80.1k | OPENSSL_free(data_); | 234 | 80.1k | data_ = new_data; | 235 | 80.1k | size_ = new_size; | 236 | 80.1k | } |
|
237 | | |
238 | | // Release releases ownership of the array to a raw pointer supplied by the |
239 | | // caller. |
240 | 505k | void Release(T **out, size_t *out_size) { |
241 | 505k | *out = data_; |
242 | 505k | *out_size = size_; |
243 | 505k | data_ = nullptr; |
244 | 505k | size_ = 0; |
245 | 505k | } bssl::Array<unsigned char>::Release(unsigned char**, unsigned long*) Line | Count | Source | 240 | 447k | void Release(T **out, size_t *out_size) { | 241 | 447k | *out = data_; | 242 | 447k | *out_size = size_; | 243 | 447k | data_ = nullptr; | 244 | 447k | size_ = 0; | 245 | 447k | } |
bssl::Array<unsigned short>::Release(unsigned short**, unsigned long*) Line | Count | Source | 240 | 37.4k | void Release(T **out, size_t *out_size) { | 241 | 37.4k | *out = data_; | 242 | 37.4k | *out_size = size_; | 243 | 37.4k | data_ = nullptr; | 244 | 37.4k | size_ = 0; | 245 | 37.4k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Release(unsigned int**, unsigned long*) bssl::Array<bool>::Release(bool**, unsigned long*) Line | Count | Source | 240 | 20.0k | void Release(T **out, size_t *out_size) { | 241 | 20.0k | *out = data_; | 242 | 20.0k | *out_size = size_; | 243 | 20.0k | data_ = nullptr; | 244 | 20.0k | size_ = 0; | 245 | 20.0k | } |
|
246 | | |
247 | | // Init replaces the array with a newly-allocated array of `new_size` |
248 | | // value-constructed copies of `T`. It returns true on success and false on |
249 | | // error. If `T` is a primitive type like `uint8_t`, value-construction means |
250 | | // it will be zero-initialized. |
251 | 98.0k | [[nodiscard]] bool Init(size_t new_size) { |
252 | 98.0k | if (!InitUninitialized(new_size)) { |
253 | 0 | return false; |
254 | 0 | } |
255 | 98.0k | std::uninitialized_value_construct_n(data_, size_); |
256 | 98.0k | return true; |
257 | 98.0k | } Unexecuted instantiation: bssl::Array<unsigned long>::Init(unsigned long) bssl::Array<unsigned int>::Init(unsigned long) Line | Count | Source | 251 | 11.6k | [[nodiscard]] bool Init(size_t new_size) { | 252 | 11.6k | if (!InitUninitialized(new_size)) { | 253 | 0 | return false; | 254 | 0 | } | 255 | 11.6k | std::uninitialized_value_construct_n(data_, size_); | 256 | 11.6k | return true; | 257 | 11.6k | } |
bssl::Array<unsigned char>::Init(unsigned long) Line | Count | Source | 251 | 79.3k | [[nodiscard]] bool Init(size_t new_size) { | 252 | 79.3k | if (!InitUninitialized(new_size)) { | 253 | 0 | return false; | 254 | 0 | } | 255 | 79.3k | std::uninitialized_value_construct_n(data_, size_); | 256 | 79.3k | return true; | 257 | 79.3k | } |
bssl::Array<int>::Init(unsigned long) Line | Count | Source | 251 | 7.09k | [[nodiscard]] bool Init(size_t new_size) { | 252 | 7.09k | if (!InitUninitialized(new_size)) { | 253 | 0 | return false; | 254 | 0 | } | 255 | 7.09k | std::uninitialized_value_construct_n(data_, size_); | 256 | 7.09k | return true; | 257 | 7.09k | } |
|
258 | | |
259 | | // InitForOverwrite behaves like `Init` but it default-constructs each element |
260 | | // instead. This means that, if `T` is a primitive type, the array will be |
261 | | // uninitialized and thus must be filled in by the caller. |
262 | 370k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { |
263 | 370k | if (!InitUninitialized(new_size)) { |
264 | 0 | return false; |
265 | 0 | } |
266 | 370k | std::uninitialized_default_construct_n(data_, size_); |
267 | 370k | return true; |
268 | 370k | } bssl::Array<unsigned char>::InitForOverwrite(unsigned long) Line | Count | Source | 262 | 151k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 263 | 151k | if (!InitUninitialized(new_size)) { | 264 | 0 | return false; | 265 | 0 | } | 266 | 151k | std::uninitialized_default_construct_n(data_, size_); | 267 | 151k | return true; | 268 | 151k | } |
bssl::Array<unsigned short>::InitForOverwrite(unsigned long) Line | Count | Source | 262 | 174k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 263 | 174k | if (!InitUninitialized(new_size)) { | 264 | 0 | return false; | 265 | 0 | } | 266 | 174k | std::uninitialized_default_construct_n(data_, size_); | 267 | 174k | return true; | 268 | 174k | } |
bssl::Array<bool>::InitForOverwrite(unsigned long) Line | Count | Source | 262 | 20.0k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 263 | 20.0k | if (!InitUninitialized(new_size)) { | 264 | 0 | return false; | 265 | 0 | } | 266 | 20.0k | std::uninitialized_default_construct_n(data_, size_); | 267 | 20.0k | return true; | 268 | 20.0k | } |
bssl::Array<bssl::SSLCredential*>::InitForOverwrite(unsigned long) Line | Count | Source | 262 | 24.3k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 263 | 24.3k | if (!InitUninitialized(new_size)) { | 264 | 0 | return false; | 265 | 0 | } | 266 | 24.3k | std::uninitialized_default_construct_n(data_, size_); | 267 | 24.3k | return true; | 268 | 24.3k | } |
|
269 | | |
270 | | // CopyFrom replaces the array with a newly-allocated copy of `in`. It returns |
271 | | // true on success and false on error. |
272 | | // |
273 | | // `in` may not alias `this`. |
274 | 1.76M | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
275 | 1.76M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
276 | 1.76M | if (!InitUninitialized(in.size())) { |
277 | 0 | return false; |
278 | 0 | } |
279 | 1.76M | std::uninitialized_copy(in.begin(), in.end(), data_); |
280 | 1.76M | return true; |
281 | 1.76M | } bssl::Array<unsigned char>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 274 | 1.24M | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 275 | 1.24M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 276 | 1.24M | if (!InitUninitialized(in.size())) { | 277 | 0 | return false; | 278 | 0 | } | 279 | 1.24M | std::uninitialized_copy(in.begin(), in.end(), data_); | 280 | 1.24M | return true; | 281 | 1.24M | } |
bssl::Array<bool>::CopyFrom(bssl::Span<bool const, 18446744073709551615ul>) Line | Count | Source | 274 | 20.0k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 275 | 20.0k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 276 | 20.0k | if (!InitUninitialized(in.size())) { | 277 | 0 | return false; | 278 | 0 | } | 279 | 20.0k | std::uninitialized_copy(in.begin(), in.end(), data_); | 280 | 20.0k | return true; | 281 | 20.0k | } |
bssl::Array<unsigned short>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) Line | Count | Source | 274 | 385k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 275 | 385k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 276 | 385k | if (!InitUninitialized(in.size())) { | 277 | 0 | return false; | 278 | 0 | } | 279 | 385k | std::uninitialized_copy(in.begin(), in.end(), data_); | 280 | 385k | return true; | 281 | 385k | } |
bssl::Array<unsigned int>::CopyFrom(bssl::Span<unsigned int const, 18446744073709551615ul>) Line | Count | Source | 274 | 117k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 275 | 117k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 276 | 117k | if (!InitUninitialized(in.size())) { | 277 | 0 | return false; | 278 | 0 | } | 279 | 117k | std::uninitialized_copy(in.begin(), in.end(), data_); | 280 | 117k | return true; | 281 | 117k | } |
|
282 | | |
283 | | // Shrink shrinks the stored size of the array to `new_size`. It crashes if |
284 | | // the new size is larger. Note this does not shrink the allocation itself. |
285 | 26.1k | void Shrink(size_t new_size) { |
286 | 26.1k | if (new_size > size_) { |
287 | 0 | abort(); |
288 | 0 | } |
289 | 26.1k | std::destroy_n(data_ + new_size, size_ - new_size); |
290 | 26.1k | size_ = new_size; |
291 | 26.1k | } Unexecuted instantiation: bssl::Array<unsigned char>::Shrink(unsigned long) bssl::Array<unsigned short>::Shrink(unsigned long) Line | Count | Source | 285 | 6.15k | void Shrink(size_t new_size) { | 286 | 6.15k | if (new_size > size_) { | 287 | 0 | abort(); | 288 | 0 | } | 289 | 6.15k | std::destroy_n(data_ + new_size, size_ - new_size); | 290 | 6.15k | size_ = new_size; | 291 | 6.15k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Shrink(unsigned long) bssl::Array<bool>::Shrink(unsigned long) Line | Count | Source | 285 | 20.0k | void Shrink(size_t new_size) { | 286 | 20.0k | if (new_size > size_) { | 287 | 0 | abort(); | 288 | 0 | } | 289 | 20.0k | std::destroy_n(data_ + new_size, size_ - new_size); | 290 | 20.0k | size_ = new_size; | 291 | 20.0k | } |
|
292 | | |
293 | | private: |
294 | | // InitUninitialized replaces the array with a newly-allocated array of |
295 | | // `new_size` elements, but whose constructor has not yet run. On success, the |
296 | | // elements must be constructed before returning control to the caller. |
297 | 2.23M | bool InitUninitialized(size_t new_size) { |
298 | 2.23M | Reset(); |
299 | 2.23M | if (new_size == 0) { |
300 | 1.14M | return true; |
301 | 1.14M | } |
302 | | |
303 | 1.08M | if (new_size > SIZE_MAX / sizeof(T)) { |
304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
305 | 0 | return false; |
306 | 0 | } |
307 | 1.08M | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); |
308 | 1.08M | if (data_ == nullptr) { |
309 | 0 | return false; |
310 | 0 | } |
311 | 1.08M | size_ = new_size; |
312 | 1.08M | return true; |
313 | 1.08M | } bssl::Array<unsigned char>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 1.47M | bool InitUninitialized(size_t new_size) { | 298 | 1.47M | Reset(); | 299 | 1.47M | if (new_size == 0) { | 300 | 899k | return true; | 301 | 899k | } | 302 | | | 303 | 573k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 573k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 573k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 573k | size_ = new_size; | 312 | 573k | return true; | 313 | 573k | } |
bssl::Array<unsigned short>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 559k | bool InitUninitialized(size_t new_size) { | 298 | 559k | Reset(); | 299 | 559k | if (new_size == 0) { | 300 | 239k | return true; | 301 | 239k | } | 302 | | | 303 | 320k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 320k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 320k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 320k | size_ = new_size; | 312 | 320k | return true; | 313 | 320k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::InitUninitialized(unsigned long) bssl::Array<unsigned int>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 129k | bool InitUninitialized(size_t new_size) { | 298 | 129k | Reset(); | 299 | 129k | if (new_size == 0) { | 300 | 0 | return true; | 301 | 0 | } | 302 | | | 303 | 129k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 129k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 129k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 129k | size_ = new_size; | 312 | 129k | return true; | 313 | 129k | } |
bssl::Array<int>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 7.09k | bool InitUninitialized(size_t new_size) { | 298 | 7.09k | Reset(); | 299 | 7.09k | if (new_size == 0) { | 300 | 0 | return true; | 301 | 0 | } | 302 | | | 303 | 7.09k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 7.09k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 7.09k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 7.09k | size_ = new_size; | 312 | 7.09k | return true; | 313 | 7.09k | } |
bssl::Array<bool>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 40.0k | bool InitUninitialized(size_t new_size) { | 298 | 40.0k | Reset(); | 299 | 40.0k | if (new_size == 0) { | 300 | 10.2k | return true; | 301 | 10.2k | } | 302 | | | 303 | 29.8k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 29.8k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 29.8k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 29.8k | size_ = new_size; | 312 | 29.8k | return true; | 313 | 29.8k | } |
bssl::Array<bssl::SSLCredential*>::InitUninitialized(unsigned long) Line | Count | Source | 297 | 24.3k | bool InitUninitialized(size_t new_size) { | 298 | 24.3k | Reset(); | 299 | 24.3k | if (new_size == 0) { | 300 | 0 | return true; | 301 | 0 | } | 302 | | | 303 | 24.3k | if (new_size > SIZE_MAX / sizeof(T)) { | 304 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 305 | 0 | return false; | 306 | 0 | } | 307 | 24.3k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 308 | 24.3k | if (data_ == nullptr) { | 309 | 0 | return false; | 310 | 0 | } | 311 | 24.3k | size_ = new_size; | 312 | 24.3k | return true; | 313 | 24.3k | } |
|
314 | | |
315 | | T *data_ = nullptr; |
316 | | size_t size_ = 0; |
317 | | }; |
318 | | |
319 | | // Vector<T> is a resizable array of elements of `T`. |
320 | | template <typename T> |
321 | | class Vector { |
322 | | public: |
323 | 574k | Vector() = default; bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Vector() Line | Count | Source | 323 | 14.8k | Vector() = default; |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::Vector() Line | Count | Source | 323 | 155k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Vector() Line | Count | Source | 323 | 122k | Vector() = default; |
bssl::Vector<bssl::CertCompressionAlg>::Vector() Line | Count | Source | 323 | 5.14k | Vector() = default; |
bssl::Vector<bssl::ALPSConfig>::Vector() Line | Count | Source | 323 | 117k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 323 | 76.9k | Vector() = default; |
bssl::Vector<unsigned long>::Vector() Line | Count | Source | 323 | 76.9k | Vector() = default; |
Unexecuted instantiation: bssl::Vector<unsigned char>::Vector() bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 323 | 5.14k | Vector() = default; |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Vector() |
324 | | Vector(const Vector &) = delete; |
325 | 0 | Vector(Vector &&other) { *this = std::move(other); }Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
326 | 574k | ~Vector() { clear(); }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 326 | 14.8k | ~Vector() { clear(); } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::~Vector() Line | Count | Source | 326 | 155k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 326 | 122k | ~Vector() { clear(); } |
bssl::Vector<bssl::CertCompressionAlg>::~Vector() Line | Count | Source | 326 | 5.12k | ~Vector() { clear(); } |
bssl::Vector<bssl::ALPSConfig>::~Vector() Line | Count | Source | 326 | 117k | ~Vector() { clear(); } |
bssl::Vector<unsigned long>::~Vector() Line | Count | Source | 326 | 76.9k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 326 | 76.9k | ~Vector() { clear(); } |
Unexecuted instantiation: bssl::Vector<unsigned char>::~Vector() bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 326 | 5.12k | ~Vector() { clear(); } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::~Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::~Vector() |
327 | | |
328 | | Vector &operator=(const Vector &) = delete; |
329 | 0 | Vector &operator=(Vector &&other) { |
330 | 0 | clear(); |
331 | 0 | std::swap(data_, other.data_); |
332 | 0 | std::swap(size_, other.size_); |
333 | 0 | std::swap(capacity_, other.capacity_); |
334 | 0 | return *this; |
335 | 0 | } Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::operator=(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator=(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
336 | | |
337 | 0 | const T *data() const { return data_; }Unexecuted instantiation: bssl::Vector<unsigned char>::data() const Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() const |
338 | 0 | T *data() { return data_; }Unexecuted instantiation: bssl::Vector<unsigned char>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::data() |
339 | 31.8M | size_t size() const { return size_; }bssl::Vector<bssl::CertCompressionAlg>::size() const Line | Count | Source | 339 | 82 | size_t size() const { return size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::size() const Line | Count | Source | 339 | 62 | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::size() const Line | Count | Source | 339 | 48.7k | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::size() const Line | Count | Source | 339 | 31.8M | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::Vector<unsigned char>::size() const Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::size() const Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::size() const |
340 | 19.1M | bool empty() const { return size_ == 0; }bssl::Vector<bssl::ALPSConfig>::empty() const Line | Count | Source | 340 | 105k | bool empty() const { return size_ == 0; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::empty() const Line | Count | Source | 340 | 108k | bool empty() const { return size_ == 0; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::empty() const Line | Count | Source | 340 | 7 | bool empty() const { return size_ == 0; } |
bssl::Vector<unsigned long>::empty() const Line | Count | Source | 340 | 18.9M | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::empty() const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::empty() const |
341 | | |
342 | 0 | const T &operator[](size_t i) const { |
343 | 0 | BSSL_CHECK(i < size_); |
344 | 0 | return data_[i]; |
345 | 0 | } Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::operator[](unsigned long) const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) const |
346 | 31.8M | T &operator[](size_t i) { |
347 | 31.8M | BSSL_CHECK(i < size_); |
348 | 31.8M | return data_[i]; |
349 | 31.8M | } bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::operator[](unsigned long) Line | Count | Source | 346 | 53 | T &operator[](size_t i) { | 347 | 53 | BSSL_CHECK(i < size_); | 348 | 53 | return data_[i]; | 349 | 53 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::operator[](unsigned long) Line | Count | Source | 346 | 31.8M | T &operator[](size_t i) { | 347 | 31.8M | BSSL_CHECK(i < size_); | 348 | 31.8M | return data_[i]; | 349 | 31.8M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator[](unsigned long) |
350 | | |
351 | | T &front() { |
352 | | BSSL_CHECK(size_ != 0); |
353 | | return data_[0]; |
354 | | } |
355 | | const T &front() const { |
356 | | BSSL_CHECK(size_ != 0); |
357 | | return data_[0]; |
358 | | } |
359 | 18.9M | T &back() { |
360 | 18.9M | BSSL_CHECK(size_ != 0); |
361 | 18.9M | return data_[size_ - 1]; |
362 | 18.9M | } bssl::Vector<unsigned long>::back() Line | Count | Source | 359 | 18.9M | T &back() { | 360 | 18.9M | BSSL_CHECK(size_ != 0); | 361 | 18.9M | return data_[size_ - 1]; | 362 | 18.9M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::back() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::back() |
363 | | const T &back() const { |
364 | | BSSL_CHECK(size_ != 0); |
365 | | return data_[size_ - 1]; |
366 | | } |
367 | | |
368 | 472k | T *begin() { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() Line | Count | Source | 368 | 482 | T *begin() { return data_; } |
bssl::Vector<bssl::CertCompressionAlg>::begin() Line | Count | Source | 368 | 52.9k | T *begin() { return data_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::begin() Line | Count | Source | 368 | 1.82k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() Line | Count | Source | 368 | 322k | T *begin() { return data_; } |
bssl::Vector<bssl::ALPSConfig>::begin() Line | Count | Source | 368 | 79 | T *begin() { return data_; } |
bssl::Vector<unsigned long>::begin() Line | Count | Source | 368 | 45.2k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::begin() Line | Count | Source | 368 | 49.3k | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<unsigned char>::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::begin() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::begin() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::begin() |
369 | 52.7k | 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::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::begin() const Line | Count | Source | 369 | 1.48k | const T *begin() const { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() const Line | Count | Source | 369 | 51.2k | const T *begin() const { return data_; } |
Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::begin() const |
370 | 472k | T *end() { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() Line | Count | Source | 370 | 482 | T *end() { return data_ + size_; } |
bssl::Vector<bssl::CertCompressionAlg>::end() Line | Count | Source | 370 | 52.9k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::end() Line | Count | Source | 370 | 1.82k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() Line | Count | Source | 370 | 322k | T *end() { return data_ + size_; } |
bssl::Vector<bssl::ALPSConfig>::end() Line | Count | Source | 370 | 79 | T *end() { return data_ + size_; } |
bssl::Vector<unsigned long>::end() Line | Count | Source | 370 | 45.2k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::end() Line | Count | Source | 370 | 49.3k | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<unsigned char>::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::end() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::end() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::end() |
371 | 52.7k | 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::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::end() const Line | Count | Source | 371 | 1.48k | const T *end() const { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() const Line | Count | Source | 371 | 51.2k | const T *end() const { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::end() const |
372 | | |
373 | 715k | void clear() { |
374 | 715k | std::destroy_n(data_, size_); |
375 | 715k | OPENSSL_free(data_); |
376 | 715k | data_ = nullptr; |
377 | 715k | size_ = 0; |
378 | 715k | capacity_ = 0; |
379 | 715k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::clear() Line | Count | Source | 373 | 14.8k | void clear() { | 374 | 14.8k | std::destroy_n(data_, size_); | 375 | 14.8k | OPENSSL_free(data_); | 376 | 14.8k | data_ = nullptr; | 377 | 14.8k | size_ = 0; | 378 | 14.8k | capacity_ = 0; | 379 | 14.8k | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::clear() Line | Count | Source | 373 | 200k | void clear() { | 374 | 200k | std::destroy_n(data_, size_); | 375 | 200k | OPENSSL_free(data_); | 376 | 200k | data_ = nullptr; | 377 | 200k | size_ = 0; | 378 | 200k | capacity_ = 0; | 379 | 200k | } |
bssl::Vector<bssl::ALPSConfig>::clear() Line | Count | Source | 373 | 117k | void clear() { | 374 | 117k | std::destroy_n(data_, size_); | 375 | 117k | OPENSSL_free(data_); | 376 | 117k | data_ = nullptr; | 377 | 117k | size_ = 0; | 378 | 117k | capacity_ = 0; | 379 | 117k | } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::clear() Line | Count | Source | 373 | 122k | void clear() { | 374 | 122k | std::destroy_n(data_, size_); | 375 | 122k | OPENSSL_free(data_); | 376 | 122k | data_ = nullptr; | 377 | 122k | size_ = 0; | 378 | 122k | capacity_ = 0; | 379 | 122k | } |
bssl::Vector<bssl::CertCompressionAlg>::clear() Line | Count | Source | 373 | 5.12k | void clear() { | 374 | 5.12k | std::destroy_n(data_, size_); | 375 | 5.12k | OPENSSL_free(data_); | 376 | 5.12k | data_ = nullptr; | 377 | 5.12k | size_ = 0; | 378 | 5.12k | capacity_ = 0; | 379 | 5.12k | } |
bssl::Vector<unsigned long>::clear() Line | Count | Source | 373 | 122k | void clear() { | 374 | 122k | std::destroy_n(data_, size_); | 375 | 122k | OPENSSL_free(data_); | 376 | 122k | data_ = nullptr; | 377 | 122k | size_ = 0; | 378 | 122k | capacity_ = 0; | 379 | 122k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 373 | 126k | void clear() { | 374 | 126k | std::destroy_n(data_, size_); | 375 | 126k | OPENSSL_free(data_); | 376 | 126k | data_ = nullptr; | 377 | 126k | size_ = 0; | 378 | 126k | capacity_ = 0; | 379 | 126k | } |
Unexecuted instantiation: bssl::Vector<unsigned char>::clear() bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 373 | 5.12k | void clear() { | 374 | 5.12k | std::destroy_n(data_, size_); | 375 | 5.12k | OPENSSL_free(data_); | 376 | 5.12k | data_ = nullptr; | 377 | 5.12k | size_ = 0; | 378 | 5.12k | capacity_ = 0; | 379 | 5.12k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::clear() Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::clear() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::clear() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::clear() |
380 | | |
381 | 18.9M | void pop_back() { |
382 | 18.9M | BSSL_CHECK(size_ != 0); |
383 | 18.9M | std::destroy_at(&data_[size_ - 1]); |
384 | 18.9M | size_--; |
385 | 18.9M | } |
386 | | |
387 | | // Push adds `elem` at the end of the internal array, growing if necessary. It |
388 | | // returns false when allocation fails. |
389 | 19.3M | [[nodiscard]] bool Push(T elem) { |
390 | 19.3M | if (!MaybeGrow(1)) { |
391 | 0 | return false; |
392 | 0 | } |
393 | 19.3M | new (&data_[size_]) T(std::move(elem)); |
394 | 19.3M | size_++; |
395 | 19.3M | return true; |
396 | 19.3M | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>) Line | Count | Source | 389 | 6 | [[nodiscard]] bool Push(T elem) { | 390 | 6 | if (!MaybeGrow(1)) { | 391 | 0 | return false; | 392 | 0 | } | 393 | 6 | new (&data_[size_]) T(std::move(elem)); | 394 | 6 | size_++; | 395 | 6 | return true; | 396 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::Push(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> >) Line | Count | Source | 389 | 344 | [[nodiscard]] bool Push(T elem) { | 390 | 344 | if (!MaybeGrow(1)) { | 391 | 0 | return false; | 392 | 0 | } | 393 | 344 | new (&data_[size_]) T(std::move(elem)); | 394 | 344 | size_++; | 395 | 344 | return true; | 396 | 344 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::Push(bssl::ALPSConfig) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::Push(bssl::CertCompressionAlg) bssl::Vector<unsigned long>::Push(unsigned long) Line | Count | Source | 389 | 18.9M | [[nodiscard]] bool Push(T elem) { | 390 | 18.9M | if (!MaybeGrow(1)) { | 391 | 0 | return false; | 392 | 0 | } | 393 | 18.9M | new (&data_[size_]) T(std::move(elem)); | 394 | 18.9M | size_++; | 395 | 18.9M | return true; | 396 | 18.9M | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bignum_st, bssl::internal::Deleter>) Line | Count | Source | 389 | 338k | [[nodiscard]] bool Push(T elem) { | 390 | 338k | if (!MaybeGrow(1)) { | 391 | 0 | return false; | 392 | 0 | } | 393 | 338k | new (&data_[size_]) T(std::move(elem)); | 394 | 338k | size_++; | 395 | 338k | return true; | 396 | 338k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::Push(bssl::ByDirEntry::CRLSuffix) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Push(bssl::(anonymous namespace)::X509PolicyNode) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter>) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Push(bssl::(anonymous namespace)::X509PolicyLevel) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Push(v3_ext_method const*) |
397 | | |
398 | | // CopyFrom replaces the contents of the array with a copy of `in`. It returns |
399 | | // true on success and false on allocation error. |
400 | 0 | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
401 | 0 | Array<T> copy; |
402 | 0 | if (!copy.CopyFrom(in)) { |
403 | 0 | return false; |
404 | 0 | } |
405 | | |
406 | 0 | clear(); |
407 | 0 | copy.Release(&data_, &size_); |
408 | 0 | capacity_ = size_; |
409 | 0 | return true; |
410 | 0 | } |
411 | | |
412 | | // Append appends the contents of `in` to the array. It returns true on |
413 | | // success and false on allocation error. |
414 | 0 | [[nodiscard]] bool Append(Span<const T> in) { |
415 | 0 | if (!MaybeGrow(in.size())) { |
416 | 0 | return false; |
417 | 0 | } |
418 | 0 | std::uninitialized_copy(in.begin(), in.end(), data_ + size_); |
419 | 0 | size_ += in.size(); |
420 | 0 | return true; |
421 | 0 | } |
422 | | |
423 | | // AppendMove moves the contents of `in` and appends them to the array. It |
424 | | // returns true on success and false on allocation error. |
425 | 0 | [[nodiscard]] bool AppendMove(Span<T> in) { |
426 | 0 | if (!MaybeGrow(in.size())) { |
427 | 0 | return false; |
428 | 0 | } |
429 | 0 | std::uninitialized_move(in.begin(), in.end(), data_ + size_); |
430 | 0 | size_ += in.size(); |
431 | 0 | return true; |
432 | 0 | } |
433 | | |
434 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
435 | | template <typename Pred> |
436 | 739 | void EraseIf(Pred pred) { |
437 | 739 | auto it = std::remove_if(begin(), end(), pred); |
438 | 739 | std::destroy(it, end()); |
439 | 739 | size_ = it - begin(); |
440 | 739 | } tls13_client.cc:void bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::EraseIf<bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1>(bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1) Line | Count | Source | 436 | 739 | void EraseIf(Pred pred) { | 437 | 739 | auto it = std::remove_if(begin(), end(), pred); | 438 | 739 | std::destroy(it, end()); | 439 | 739 | size_ = it - begin(); | 440 | 739 | } |
Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0>(bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0) Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0>(bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0) |
441 | | |
442 | | private: |
443 | | // If there is no room for `num` elements, creates a new backing array with |
444 | | // double the size of the old one and copies elements over. |
445 | 19.3M | [[nodiscard]] bool MaybeGrow(size_t num) { |
446 | 19.3M | constexpr size_t kDefaultSize = 16; |
447 | 19.3M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); |
448 | 19.3M | if (num > kMaxCapacity - size_) { |
449 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
450 | 0 | return false; |
451 | 0 | } |
452 | 19.3M | size_t new_capacity = size_ + num; |
453 | | // No need to grow if we have room. |
454 | 19.3M | if (capacity_ >= new_capacity) { |
455 | 19.2M | return true; |
456 | 19.2M | } |
457 | | // Always grow to at least kDefaultSize to avoid several small mallocs at |
458 | | // the start. |
459 | 94.8k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); |
460 | | // At least double the old capacity for linear amortized behavior. |
461 | 94.8k | if (capacity_ <= kMaxCapacity / 2) { |
462 | 94.8k | new_capacity = std::max(new_capacity, capacity_ * 2); |
463 | 94.8k | } |
464 | 94.8k | T *new_data = |
465 | 94.8k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); |
466 | 94.8k | if (new_data == nullptr) { |
467 | 0 | return false; |
468 | 0 | } |
469 | 94.8k | size_t new_size = size_; |
470 | 94.8k | std::uninitialized_move(begin(), end(), new_data); |
471 | 94.8k | clear(); |
472 | 94.8k | data_ = new_data; |
473 | 94.8k | size_ = new_size; |
474 | 94.8k | capacity_ = new_capacity; |
475 | 94.8k | return true; |
476 | 94.8k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 445 | 6 | [[nodiscard]] bool MaybeGrow(size_t num) { | 446 | 6 | constexpr size_t kDefaultSize = 16; | 447 | 6 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 448 | 6 | if (num > kMaxCapacity - size_) { | 449 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 450 | 0 | return false; | 451 | 0 | } | 452 | 6 | size_t new_capacity = size_ + num; | 453 | | // No need to grow if we have room. | 454 | 6 | if (capacity_ >= new_capacity) { | 455 | 0 | return true; | 456 | 0 | } | 457 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 458 | | // the start. | 459 | 6 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 460 | | // At least double the old capacity for linear amortized behavior. | 461 | 6 | if (capacity_ <= kMaxCapacity / 2) { | 462 | 6 | new_capacity = std::max(new_capacity, capacity_ * 2); | 463 | 6 | } | 464 | 6 | T *new_data = | 465 | 6 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 466 | 6 | if (new_data == nullptr) { | 467 | 0 | return false; | 468 | 0 | } | 469 | 6 | size_t new_size = size_; | 470 | 6 | std::uninitialized_move(begin(), end(), new_data); | 471 | 6 | clear(); | 472 | 6 | data_ = new_data; | 473 | 6 | size_ = new_size; | 474 | 6 | capacity_ = new_capacity; | 475 | 6 | return true; | 476 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<ssl_session_st, bssl::internal::Deleter> > >::MaybeGrow(unsigned long) Line | Count | Source | 445 | 344 | [[nodiscard]] bool MaybeGrow(size_t num) { | 446 | 344 | constexpr size_t kDefaultSize = 16; | 447 | 344 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 448 | 344 | if (num > kMaxCapacity - size_) { | 449 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 450 | 0 | return false; | 451 | 0 | } | 452 | 344 | size_t new_capacity = size_ + num; | 453 | | // No need to grow if we have room. | 454 | 344 | if (capacity_ >= new_capacity) { | 455 | 0 | return true; | 456 | 0 | } | 457 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 458 | | // the start. | 459 | 344 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 460 | | // At least double the old capacity for linear amortized behavior. | 461 | 344 | if (capacity_ <= kMaxCapacity / 2) { | 462 | 344 | new_capacity = std::max(new_capacity, capacity_ * 2); | 463 | 344 | } | 464 | 344 | T *new_data = | 465 | 344 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 466 | 344 | if (new_data == nullptr) { | 467 | 0 | return false; | 468 | 0 | } | 469 | 344 | size_t new_size = size_; | 470 | 344 | std::uninitialized_move(begin(), end(), new_data); | 471 | 344 | clear(); | 472 | 344 | data_ = new_data; | 473 | 344 | size_ = new_size; | 474 | 344 | capacity_ = new_capacity; | 475 | 344 | return true; | 476 | 344 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::MaybeGrow(unsigned long) bssl::Vector<unsigned long>::MaybeGrow(unsigned long) Line | Count | Source | 445 | 18.9M | [[nodiscard]] bool MaybeGrow(size_t num) { | 446 | 18.9M | constexpr size_t kDefaultSize = 16; | 447 | 18.9M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 448 | 18.9M | if (num > kMaxCapacity - size_) { | 449 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 450 | 0 | return false; | 451 | 0 | } | 452 | 18.9M | size_t new_capacity = size_ + num; | 453 | | // No need to grow if we have room. | 454 | 18.9M | if (capacity_ >= new_capacity) { | 455 | 18.9M | return true; | 456 | 18.9M | } | 457 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 458 | | // the start. | 459 | 45.2k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 460 | | // At least double the old capacity for linear amortized behavior. | 461 | 45.2k | if (capacity_ <= kMaxCapacity / 2) { | 462 | 45.2k | new_capacity = std::max(new_capacity, capacity_ * 2); | 463 | 45.2k | } | 464 | 45.2k | T *new_data = | 465 | 45.2k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 466 | 45.2k | if (new_data == nullptr) { | 467 | 0 | return false; | 468 | 0 | } | 469 | 45.2k | size_t new_size = size_; | 470 | 45.2k | std::uninitialized_move(begin(), end(), new_data); | 471 | 45.2k | clear(); | 472 | 45.2k | data_ = new_data; | 473 | 45.2k | size_ = new_size; | 474 | 45.2k | capacity_ = new_capacity; | 475 | 45.2k | return true; | 476 | 45.2k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 445 | 338k | [[nodiscard]] bool MaybeGrow(size_t num) { | 446 | 338k | constexpr size_t kDefaultSize = 16; | 447 | 338k | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 448 | 338k | if (num > kMaxCapacity - size_) { | 449 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 450 | 0 | return false; | 451 | 0 | } | 452 | 338k | size_t new_capacity = size_ + num; | 453 | | // No need to grow if we have room. | 454 | 338k | if (capacity_ >= new_capacity) { | 455 | 289k | return true; | 456 | 289k | } | 457 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 458 | | // the start. | 459 | 49.3k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 460 | | // At least double the old capacity for linear amortized behavior. | 461 | 49.3k | if (capacity_ <= kMaxCapacity / 2) { | 462 | 49.3k | new_capacity = std::max(new_capacity, capacity_ * 2); | 463 | 49.3k | } | 464 | 49.3k | T *new_data = | 465 | 49.3k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 466 | 49.3k | if (new_data == nullptr) { | 467 | 0 | return false; | 468 | 0 | } | 469 | 49.3k | size_t new_size = size_; | 470 | 49.3k | std::uninitialized_move(begin(), end(), new_data); | 471 | 49.3k | clear(); | 472 | 49.3k | data_ = new_data; | 473 | 49.3k | size_ = new_size; | 474 | 49.3k | capacity_ = new_capacity; | 475 | 49.3k | return true; | 476 | 49.3k | } |
Unexecuted instantiation: bssl::Vector<unsigned char>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::ByDirEntry, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::ByDirEntry::CRLSuffix>::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::MaybeGrow(unsigned long) |
477 | | |
478 | | // data_ is a pointer to `capacity_` objects of size `T`, the first `size_` of |
479 | | // which are constructed. |
480 | | T *data_ = nullptr; |
481 | | // `size_` is the number of elements stored in this Vector. |
482 | | size_t size_ = 0; |
483 | | // `capacity_` is the number of elements allocated in this Vector. |
484 | | size_t capacity_ = 0; |
485 | | }; |
486 | | |
487 | | // A PackedSize is an integer that can store values from 0 to N, represented as |
488 | | // a minimal-width integer. |
489 | | template <size_t N> |
490 | | using PackedSize = std::conditional_t< |
491 | | N <= 0xff, uint8_t, |
492 | | std::conditional_t<N <= 0xffff, uint16_t, |
493 | | std::conditional_t<N <= 0xffffffff, uint32_t, size_t>>>; |
494 | | |
495 | | // An InplaceVector is like a Vector, but stores up to N elements inline in the |
496 | | // object. It is inspired by std::inplace_vector in C++26. |
497 | | template <typename T, size_t N> |
498 | | class InplaceVector { |
499 | | public: |
500 | | using value_type = std::remove_cv_t<T>; |
501 | | |
502 | 4.18M | InplaceVector() = default; bssl::InplaceVector<unsigned short, 2ul>::InplaceVector() Line | Count | Source | 502 | 51.8k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 2ul>::InplaceVector() Line | Count | Source | 502 | 452k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 48ul>::InplaceVector() Line | Count | Source | 502 | 2.05M | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::InplaceVector() Line | Count | Source | 502 | 155k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 32ul>::InplaceVector() Line | Count | Source | 502 | 737k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 12ul>::InplaceVector() Line | Count | Source | 502 | 602k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::InplaceVector() Line | Count | Source | 502 | 42.9k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::InplaceVector() Line | Count | Source | 502 | 10.7k | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::InplaceVector() Line | Count | Source | 502 | 40.6k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::InplaceVector() Line | Count | Source | 502 | 40.6k | InplaceVector() = default; |
bssl::InplaceVector<crypto_iovec_st, 16ul>::InplaceVector() Line | Count | Source | 502 | 3.76k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::InplaceVector() |
503 | 32.8k | InplaceVector(const InplaceVector &other) { *this = other; } |
504 | 40.6k | InplaceVector(InplaceVector &&other) { *this = std::move(other); } |
505 | 4.26M | ~InplaceVector() { clear(); }bssl::InplaceVector<unsigned char, 48ul>::~InplaceVector() Line | Count | Source | 505 | 2.12M | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned short, 2ul>::~InplaceVector() Line | Count | Source | 505 | 51.8k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 2ul>::~InplaceVector() Line | Count | Source | 505 | 452k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::~InplaceVector() Line | Count | Source | 505 | 155k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 32ul>::~InplaceVector() Line | Count | Source | 505 | 737k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 12ul>::~InplaceVector() Line | Count | Source | 505 | 602k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::~InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::~InplaceVector() Line | Count | Source | 505 | 42.9k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::~InplaceVector() Line | Count | Source | 505 | 10.7k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::~InplaceVector() Line | Count | Source | 505 | 40.6k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::~InplaceVector() Line | Count | Source | 505 | 40.6k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::~InplaceVector() bssl::InplaceVector<crypto_iovec_st, 16ul>::~InplaceVector() Line | Count | Source | 505 | 3.76k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::~InplaceVector() |
506 | 340k | InplaceVector &operator=(const InplaceVector &other) { |
507 | 340k | if (this != &other) { |
508 | 340k | CopyFrom(other); |
509 | 340k | } |
510 | 340k | return *this; |
511 | 340k | } bssl::InplaceVector<unsigned char, 32ul>::operator=(bssl::InplaceVector<unsigned char, 32ul> const&) Line | Count | Source | 506 | 213k | InplaceVector &operator=(const InplaceVector &other) { | 507 | 213k | if (this != &other) { | 508 | 213k | CopyFrom(other); | 509 | 213k | } | 510 | 213k | return *this; | 511 | 213k | } |
bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul> const&) Line | Count | Source | 506 | 127k | InplaceVector &operator=(const InplaceVector &other) { | 507 | 127k | if (this != &other) { | 508 | 127k | CopyFrom(other); | 509 | 127k | } | 510 | 127k | return *this; | 511 | 127k | } |
|
512 | 109k | InplaceVector &operator=(InplaceVector &&other) { |
513 | 109k | clear(); |
514 | 109k | std::uninitialized_move(other.begin(), other.end(), data()); |
515 | 109k | size_ = other.size(); |
516 | 109k | return *this; |
517 | 109k | } bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul>&&) Line | Count | Source | 512 | 109k | InplaceVector &operator=(InplaceVector &&other) { | 513 | 109k | clear(); | 514 | 109k | std::uninitialized_move(other.begin(), other.end(), data()); | 515 | 109k | size_ = other.size(); | 516 | 109k | return *this; | 517 | 109k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::operator=(bssl::InplaceVector<unsigned char, 2ul>&&) |
518 | | |
519 | 2.93M | const T *data() const { return reinterpret_cast<const T *>(storage_); }bssl::InplaceVector<unsigned char, 2ul>::data() const Line | Count | Source | 519 | 471k | 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 | 519 | 51.2k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 48ul>::data() const Line | Count | Source | 519 | 879k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() const Line | Count | Source | 519 | 177k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() const Line | Count | Source | 519 | 1.35M | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() const bssl::InplaceVector<crypto_iovec_st, 16ul>::data() const Line | Count | Source | 519 | 7.52k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
|
520 | 9.76M | T *data() { return reinterpret_cast<T *>(storage_); }bssl::InplaceVector<unsigned char, 48ul>::data() Line | Count | Source | 520 | 3.83M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 2ul>::data() Line | Count | Source | 520 | 1.18M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() Line | Count | Source | 520 | 1.09M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::data() Line | Count | Source | 520 | 384k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned short, 2ul>::data() Line | Count | Source | 520 | 410k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() Line | Count | Source | 520 | 2.06M | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::data() Line | Count | Source | 520 | 255k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::data() Line | Count | Source | 520 | 226k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::data() Line | Count | Source | 520 | 33.1k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::data() Line | Count | Source | 520 | 268k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::data() Line | Count | Source | 520 | 15.0k | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::data() |
521 | 4.41M | size_t size() const { return size_; }bssl::InplaceVector<unsigned char, 12ul>::size() const Line | Count | Source | 521 | 429k | 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 | 521 | 153k | size_t size() const { return size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::size() const Line | Count | Source | 521 | 109k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 2ul>::size() const Line | Count | Source | 521 | 529k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 48ul>::size() const Line | Count | Source | 521 | 1.22M | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 32ul>::size() const Line | Count | Source | 521 | 1.40M | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::size() const bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::size() const Line | Count | Source | 521 | 187k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::size() const Line | Count | Source | 521 | 303k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::size() const Line | Count | Source | 521 | 45.7k | size_t size() const { return size_; } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::size() const Line | Count | Source | 521 | 11.2k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::size() const Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::size() const bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::size() const Line | Count | Source | 521 | 8.12k | size_t size() const { return size_; } |
|
522 | 2.11M | static constexpr size_t capacity() { return N; }bssl::InplaceVector<unsigned char, 2ul>::capacity() Line | Count | Source | 522 | 240k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned short, 2ul>::capacity() Line | Count | Source | 522 | 102k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::capacity() Line | Count | Source | 522 | 109k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 32ul>::capacity() Line | Count | Source | 522 | 676k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 48ul>::capacity() Line | Count | Source | 522 | 574k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 12ul>::capacity() Line | Count | Source | 522 | 253k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::capacity() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::capacity() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::capacity() Line | Count | Source | 522 | 31.7k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::capacity() Line | Count | Source | 522 | 89.5k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::capacity() Line | Count | Source | 522 | 19.8k | 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 | 522 | 3.76k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::capacity() bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::capacity() Line | Count | Source | 522 | 8.12k | static constexpr size_t capacity() { return N; } |
|
523 | 414k | bool empty() const { return size_ == 0; }bssl::InplaceVector<unsigned char, 12ul>::empty() const Line | Count | Source | 523 | 75.8k | 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 | 523 | 4.52k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 2ul>::empty() const Line | Count | Source | 523 | 266k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 48ul>::empty() const Line | Count | Source | 523 | 2.58k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 32ul>::empty() const Line | Count | Source | 523 | 49.3k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::empty() const Line | Count | Source | 523 | 15.5k | bool empty() const { return size_ == 0; } |
|
524 | | |
525 | | const T &operator[](size_t i) const { |
526 | | BSSL_CHECK(i < size_); |
527 | | return data()[i]; |
528 | | } |
529 | 558k | T &operator[](size_t i) { |
530 | 558k | BSSL_CHECK(i < size_); |
531 | 558k | return data()[i]; |
532 | 558k | } bssl::InplaceVector<unsigned short, 2ul>::operator[](unsigned long) Line | Count | Source | 529 | 256k | T &operator[](size_t i) { | 530 | 256k | BSSL_CHECK(i < size_); | 531 | 256k | return data()[i]; | 532 | 256k | } |
bssl::InplaceVector<unsigned char, 2ul>::operator[](unsigned long) Line | Count | Source | 529 | 52.9k | T &operator[](size_t i) { | 530 | 52.9k | BSSL_CHECK(i < size_); | 531 | 52.9k | return data()[i]; | 532 | 52.9k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::operator[](unsigned long) Line | Count | Source | 529 | 9.63k | T &operator[](size_t i) { | 530 | 9.63k | BSSL_CHECK(i < size_); | 531 | 9.63k | return data()[i]; | 532 | 9.63k | } |
bssl::InplaceVector<unsigned char, 12ul>::operator[](unsigned long) Line | Count | Source | 529 | 52.4k | T &operator[](size_t i) { | 530 | 52.4k | BSSL_CHECK(i < size_); | 531 | 52.4k | return data()[i]; | 532 | 52.4k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::operator[](unsigned long) Line | Count | Source | 529 | 71.5k | T &operator[](size_t i) { | 530 | 71.5k | BSSL_CHECK(i < size_); | 531 | 71.5k | return data()[i]; | 532 | 71.5k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::operator[](unsigned long) Line | Count | Source | 529 | 2.57k | T &operator[](size_t i) { | 530 | 2.57k | BSSL_CHECK(i < size_); | 531 | 2.57k | return data()[i]; | 532 | 2.57k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::operator[](unsigned long) Line | Count | Source | 529 | 113k | T &operator[](size_t i) { | 530 | 113k | BSSL_CHECK(i < size_); | 531 | 113k | return data()[i]; | 532 | 113k | } |
|
533 | | |
534 | | T &front() { |
535 | | BSSL_CHECK(size_ != 0); |
536 | | return data()[0]; |
537 | | } |
538 | | const T &front() const { |
539 | | BSSL_CHECK(size_ != 0); |
540 | | return data()[0]; |
541 | | } |
542 | | T &back() { |
543 | | BSSL_CHECK(size_ != 0); |
544 | | return data()[size_ - 1]; |
545 | | } |
546 | | const T &back() const { |
547 | | BSSL_CHECK(size_ != 0); |
548 | | return data()[size_ - 1]; |
549 | | } |
550 | | |
551 | 296k | T *begin() { return data(); }bssl::InplaceVector<unsigned char, 48ul>::begin() Line | Count | Source | 551 | 109k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::begin() Line | Count | Source | 551 | 2.72k | T *begin() { return data(); } |
bssl::InplaceVector<unsigned char, 2ul>::begin() Line | Count | Source | 551 | 50.7k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::begin() Line | Count | Source | 551 | 4.68k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::begin() Line | Count | Source | 551 | 19.5k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::begin() Line | Count | Source | 551 | 109k | T *begin() { return data(); } |
|
552 | | const T *begin() const { return data(); } |
553 | 306k | T *end() { return data() + size_; }bssl::InplaceVector<unsigned char, 48ul>::end() Line | Count | Source | 553 | 109k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::end() Line | Count | Source | 553 | 5.44k | T *end() { return data() + size_; } |
bssl::InplaceVector<unsigned char, 2ul>::end() Line | Count | Source | 553 | 97.2k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::end() Line | Count | Source | 553 | 4.68k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::end() Line | Count | Source | 553 | 19.5k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::end() Line | Count | Source | 553 | 70.5k | T *end() { return data() + size_; } |
|
554 | | const T *end() const { return data() + size_; } |
555 | | |
556 | 6.01M | void clear() { Shrink(0); }bssl::InplaceVector<unsigned char, 48ul>::clear() Line | Count | Source | 556 | 2.69M | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::clear() Line | Count | Source | 556 | 257k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned short, 2ul>::clear() Line | Count | Source | 556 | 51.8k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 2ul>::clear() Line | Count | Source | 556 | 738k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 32ul>::clear() Line | Count | Source | 556 | 1.30M | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 12ul>::clear() Line | Count | Source | 556 | 780k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::clear() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::clear() Line | Count | Source | 556 | 55.5k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::clear() Line | Count | Source | 556 | 10.7k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::clear() Line | Count | Source | 556 | 71.0k | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::clear() Line | Count | Source | 556 | 40.6k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::clear() bssl::InplaceVector<crypto_iovec_st, 16ul>::clear() Line | Count | Source | 556 | 7.52k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::clear() |
557 | | |
558 | | void pop_back() { |
559 | | BSSL_CHECK(size_ != 0); |
560 | | Shrink(size_ - 1); |
561 | | } |
562 | | |
563 | | // Shrink resizes the vector to `new_size`, which must not be larger than the |
564 | | // current size. Unlike `Resize`, this can be called when `T` is not |
565 | | // default-constructible. |
566 | 6.05M | void Shrink(size_t new_size) { |
567 | 6.05M | BSSL_CHECK(new_size <= size_); |
568 | 6.05M | std::destroy_n(data() + new_size, size_ - new_size); |
569 | 6.05M | size_ = static_cast<PackedSize<N>>(new_size); |
570 | 6.05M | } bssl::InplaceVector<unsigned char, 48ul>::Shrink(unsigned long) Line | Count | Source | 566 | 2.69M | void Shrink(size_t new_size) { | 567 | 2.69M | BSSL_CHECK(new_size <= size_); | 568 | 2.69M | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 2.69M | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 2.69M | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 7ul>::Shrink(unsigned long) Line | Count | Source | 566 | 257k | void Shrink(size_t new_size) { | 567 | 257k | BSSL_CHECK(new_size <= size_); | 568 | 257k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 257k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 257k | } |
bssl::InplaceVector<unsigned short, 2ul>::Shrink(unsigned long) Line | Count | Source | 566 | 51.8k | void Shrink(size_t new_size) { | 567 | 51.8k | BSSL_CHECK(new_size <= size_); | 568 | 51.8k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 51.8k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 51.8k | } |
bssl::InplaceVector<unsigned char, 2ul>::Shrink(unsigned long) Line | Count | Source | 566 | 738k | void Shrink(size_t new_size) { | 567 | 738k | BSSL_CHECK(new_size <= size_); | 568 | 738k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 738k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 738k | } |
bssl::InplaceVector<unsigned char, 32ul>::Shrink(unsigned long) Line | Count | Source | 566 | 1.30M | void Shrink(size_t new_size) { | 567 | 1.30M | BSSL_CHECK(new_size <= size_); | 568 | 1.30M | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 1.30M | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 1.30M | } |
bssl::InplaceVector<unsigned char, 12ul>::Shrink(unsigned long) Line | Count | Source | 566 | 780k | void Shrink(size_t new_size) { | 567 | 780k | BSSL_CHECK(new_size <= size_); | 568 | 780k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 780k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 780k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 7ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Shrink(unsigned long) bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::Shrink(unsigned long) Line | Count | Source | 566 | 55.5k | void Shrink(size_t new_size) { | 567 | 55.5k | BSSL_CHECK(new_size <= size_); | 568 | 55.5k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 55.5k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 55.5k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::Shrink(unsigned long) Line | Count | Source | 566 | 10.7k | void Shrink(size_t new_size) { | 567 | 10.7k | BSSL_CHECK(new_size <= size_); | 568 | 10.7k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 10.7k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 10.7k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::Shrink(unsigned long) Line | Count | Source | 566 | 71.0k | void Shrink(size_t new_size) { | 567 | 71.0k | BSSL_CHECK(new_size <= size_); | 568 | 71.0k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 71.0k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 71.0k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::Shrink(unsigned long) Line | Count | Source | 566 | 80.0k | void Shrink(size_t new_size) { | 567 | 80.0k | BSSL_CHECK(new_size <= size_); | 568 | 80.0k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 80.0k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 80.0k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Shrink(unsigned long) bssl::InplaceVector<crypto_iovec_st, 16ul>::Shrink(unsigned long) Line | Count | Source | 566 | 7.52k | void Shrink(size_t new_size) { | 567 | 7.52k | BSSL_CHECK(new_size <= size_); | 568 | 7.52k | std::destroy_n(data() + new_size, size_ - new_size); | 569 | 7.52k | size_ = static_cast<PackedSize<N>>(new_size); | 570 | 7.52k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Shrink(unsigned long) |
571 | | |
572 | | // TryResize resizes the vector to `new_size` and returns true, or returns |
573 | | // false if `new_size` is too large. Any newly-added elements are |
574 | | // value-initialized. |
575 | 6.84k | [[nodiscard]] bool TryResize(size_t new_size) { |
576 | 6.84k | if (new_size <= size_) { |
577 | 0 | Shrink(new_size); |
578 | 0 | return true; |
579 | 0 | } |
580 | 6.84k | if (new_size > capacity()) { |
581 | 0 | return false; |
582 | 0 | } |
583 | 6.84k | std::uninitialized_value_construct_n(data() + size_, new_size - size_); |
584 | 6.84k | size_ = static_cast<PackedSize<N>>(new_size); |
585 | 6.84k | return true; |
586 | 6.84k | } |
587 | | |
588 | | // TryResizeForOverwrite behaves like `TryResize`, but newly-added elements |
589 | | // are default-initialized, so POD types may contain uninitialized values that |
590 | | // the caller is responsible for filling in. |
591 | 206k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { |
592 | 206k | if (new_size <= size_) { |
593 | 188 | Shrink(new_size); |
594 | 188 | return true; |
595 | 188 | } |
596 | 205k | if (new_size > capacity()) { |
597 | 0 | return false; |
598 | 0 | } |
599 | 205k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); |
600 | 205k | size_ = static_cast<PackedSize<N>>(new_size); |
601 | 205k | return true; |
602 | 205k | } bssl::InplaceVector<unsigned char, 32ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 591 | 95.5k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 592 | 95.5k | if (new_size <= size_) { | 593 | 23 | Shrink(new_size); | 594 | 23 | return true; | 595 | 23 | } | 596 | 95.5k | if (new_size > capacity()) { | 597 | 0 | return false; | 598 | 0 | } | 599 | 95.5k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 600 | 95.5k | size_ = static_cast<PackedSize<N>>(new_size); | 601 | 95.5k | return true; | 602 | 95.5k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 591 | 110k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 592 | 110k | if (new_size <= size_) { | 593 | 165 | Shrink(new_size); | 594 | 165 | return true; | 595 | 165 | } | 596 | 110k | if (new_size > capacity()) { | 597 | 0 | return false; | 598 | 0 | } | 599 | 110k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 600 | 110k | size_ = static_cast<PackedSize<N>>(new_size); | 601 | 110k | return true; | 602 | 110k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::TryResizeForOverwrite(unsigned long) |
603 | | |
604 | | // TryCopyFrom sets the vector to a copy of `in` and returns true, or returns |
605 | | // false if `in` is too large. |
606 | | // |
607 | | // `in` may not alias `this`. |
608 | 1.45M | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { |
609 | 1.45M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
610 | 1.45M | if (in.size() > capacity()) { |
611 | 15.7k | return false; |
612 | 15.7k | } |
613 | 1.43M | clear(); |
614 | 1.43M | std::uninitialized_copy(in.begin(), in.end(), data()); |
615 | 1.43M | size_ = in.size(); |
616 | 1.43M | return true; |
617 | 1.45M | } bssl::InplaceVector<unsigned char, 2ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 608 | 235k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 609 | 235k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 610 | 235k | if (in.size() > capacity()) { | 611 | 0 | return false; | 612 | 0 | } | 613 | 235k | clear(); | 614 | 235k | std::uninitialized_copy(in.begin(), in.end(), data()); | 615 | 235k | size_ = in.size(); | 616 | 235k | return true; | 617 | 235k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 608 | 457k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 609 | 457k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 610 | 457k | if (in.size() > capacity()) { | 611 | 27 | return false; | 612 | 27 | } | 613 | 457k | clear(); | 614 | 457k | std::uninitialized_copy(in.begin(), in.end(), data()); | 615 | 457k | size_ = in.size(); | 616 | 457k | return true; | 617 | 457k | } |
bssl::InplaceVector<unsigned char, 12ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 608 | 177k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 609 | 177k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 610 | 177k | if (in.size() > capacity()) { | 611 | 0 | return false; | 612 | 0 | } | 613 | 177k | clear(); | 614 | 177k | std::uninitialized_copy(in.begin(), in.end(), data()); | 615 | 177k | size_ = in.size(); | 616 | 177k | return true; | 617 | 177k | } |
bssl::InplaceVector<unsigned char, 32ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 608 | 581k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 609 | 581k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 610 | 581k | if (in.size() > capacity()) { | 611 | 15.7k | return false; | 612 | 15.7k | } | 613 | 565k | clear(); | 614 | 565k | std::uninitialized_copy(in.begin(), in.end(), data()); | 615 | 565k | size_ = in.size(); | 616 | 565k | return true; | 617 | 581k | } |
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 | 608 | 3.76k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 609 | 3.76k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 610 | 3.76k | if (in.size() > capacity()) { | 611 | 0 | return false; | 612 | 0 | } | 613 | 3.76k | clear(); | 614 | 3.76k | std::uninitialized_copy(in.begin(), in.end(), data()); | 615 | 3.76k | size_ = in.size(); | 616 | 3.76k | return true; | 617 | 3.76k | } |
|
618 | | |
619 | | // TryAppend appends the vector by a copy of `in` and returns true, or |
620 | | // returns false if `in` is too large. |
621 | 0 | [[nodiscard]] bool TryAppend(Span<const T> in) { |
622 | 0 | if (in.size() > capacity() - size()) { |
623 | 0 | return false; |
624 | 0 | } |
625 | 0 | std::uninitialized_copy(in.begin(), in.end(), &data()[size_]); |
626 | 0 | size_ += in.size(); |
627 | 0 | return true; |
628 | 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>) |
629 | | |
630 | | // TryPushBack appends `val` to the vector and returns a pointer to the |
631 | | // newly-inserted value, or nullptr if the vector is at capacity. |
632 | 365k | [[nodiscard]] T *TryPushBack(T val) { |
633 | 365k | if (size() >= capacity()) { |
634 | 0 | return nullptr; |
635 | 0 | } |
636 | 365k | T *ret = &data()[size_]; |
637 | 365k | new (ret) T(std::move(val)); |
638 | 365k | size_++; |
639 | 365k | return ret; |
640 | 365k | } bssl::InplaceVector<unsigned char, 2ul>::TryPushBack(unsigned char) Line | Count | Source | 632 | 5.14k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 5.14k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 5.14k | T *ret = &data()[size_]; | 637 | 5.14k | new (ret) T(std::move(val)); | 638 | 5.14k | size_++; | 639 | 5.14k | return ret; | 640 | 5.14k | } |
bssl::InplaceVector<unsigned short, 2ul>::TryPushBack(unsigned short) Line | Count | Source | 632 | 102k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 102k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 102k | T *ret = &data()[size_]; | 637 | 102k | new (ret) T(std::move(val)); | 638 | 102k | size_++; | 639 | 102k | return ret; | 640 | 102k | } |
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 | 632 | 109k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 109k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 109k | T *ret = &data()[size_]; | 637 | 109k | new (ret) T(std::move(val)); | 638 | 109k | size_++; | 639 | 109k | return ret; | 640 | 109k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::TryPushBack(bssl::DTLSOutgoingMessage) Line | Count | Source | 632 | 31.7k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 31.7k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 31.7k | T *ret = &data()[size_]; | 637 | 31.7k | new (ret) T(std::move(val)); | 638 | 31.7k | size_++; | 639 | 31.7k | return ret; | 640 | 31.7k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::TryPushBack(bssl::DTLSRecordNumber) Line | Count | Source | 632 | 89.5k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 89.5k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 89.5k | T *ret = &data()[size_]; | 637 | 89.5k | new (ret) T(std::move(val)); | 638 | 89.5k | size_++; | 639 | 89.5k | return ret; | 640 | 89.5k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::TryPushBack(bssl::DTLSSentRecord) Line | Count | Source | 632 | 19.8k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 19.8k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 19.8k | T *ret = &data()[size_]; | 637 | 19.8k | new (ret) T(std::move(val)); | 638 | 19.8k | size_++; | 639 | 19.8k | return ret; | 640 | 19.8k | } |
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 | 632 | 8.12k | [[nodiscard]] T *TryPushBack(T val) { | 633 | 8.12k | if (size() >= capacity()) { | 634 | 0 | return nullptr; | 635 | 0 | } | 636 | 8.12k | T *ret = &data()[size_]; | 637 | 8.12k | new (ret) T(std::move(val)); | 638 | 8.12k | size_++; | 639 | 8.12k | return ret; | 640 | 8.12k | } |
|
641 | | |
642 | | // The following methods behave like their `Try*` counterparts, but abort the |
643 | | // program on failure. |
644 | 6.84k | void Resize(size_t size) { BSSL_CHECK(TryResize(size)); } |
645 | 206k | void ResizeForOverwrite(size_t size) { |
646 | 206k | BSSL_CHECK(TryResizeForOverwrite(size)); |
647 | 206k | } bssl::InplaceVector<unsigned char, 32ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 645 | 95.5k | void ResizeForOverwrite(size_t size) { | 646 | 95.5k | BSSL_CHECK(TryResizeForOverwrite(size)); | 647 | 95.5k | } |
bssl::InplaceVector<unsigned char, 48ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 645 | 110k | void ResizeForOverwrite(size_t size) { | 646 | 110k | BSSL_CHECK(TryResizeForOverwrite(size)); | 647 | 110k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::ResizeForOverwrite(unsigned long) |
648 | 629k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); }Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 12ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 648 | 137k | 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 | 648 | 267k | 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 | 648 | 220k | 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 | 648 | 3.76k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
|
649 | 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>) |
650 | 122k | T &PushBack(T val) { |
651 | 122k | T *ret = TryPushBack(std::move(val)); |
652 | 122k | BSSL_CHECK(ret != nullptr); |
653 | 122k | return *ret; |
654 | 122k | } bssl::InplaceVector<unsigned char, 2ul>::PushBack(unsigned char) Line | Count | Source | 650 | 5.14k | T &PushBack(T val) { | 651 | 5.14k | T *ret = TryPushBack(std::move(val)); | 652 | 5.14k | BSSL_CHECK(ret != nullptr); | 653 | 5.14k | return *ret; | 654 | 5.14k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::PushBack(bssl::DTLSRecordNumber) Line | Count | Source | 650 | 89.5k | T &PushBack(T val) { | 651 | 89.5k | T *ret = TryPushBack(std::move(val)); | 652 | 89.5k | BSSL_CHECK(ret != nullptr); | 653 | 89.5k | return *ret; | 654 | 89.5k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::PushBack(bssl::DTLSSentRecord) Line | Count | Source | 650 | 19.8k | T &PushBack(T val) { | 651 | 19.8k | T *ret = TryPushBack(std::move(val)); | 652 | 19.8k | BSSL_CHECK(ret != nullptr); | 653 | 19.8k | return *ret; | 654 | 19.8k | } |
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 | 650 | 8.12k | T &PushBack(T val) { | 651 | 8.12k | T *ret = TryPushBack(std::move(val)); | 652 | 8.12k | BSSL_CHECK(ret != nullptr); | 653 | 8.12k | return *ret; | 654 | 8.12k | } |
|
655 | | |
656 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
657 | | template <typename Pred> |
658 | 39.4k | void EraseIf(Pred pred) { |
659 | 39.4k | auto it = std::remove_if(begin(), end(), pred); |
660 | 39.4k | Shrink(it - begin()); |
661 | 39.4k | } |
662 | | |
663 | | private: |
664 | | alignas(T) char storage_[sizeof(T[N])]; |
665 | | PackedSize<N> size_ = 0; |
666 | | }; |
667 | | |
668 | | |
669 | | BSSL_NAMESPACE_END |
670 | | |
671 | | #endif // OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |