/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 | 11.9M | T *New(Args &&...args) { |
56 | 11.9M | void *t = OPENSSL_malloc(sizeof(T)); |
57 | 11.9M | if (t == nullptr) { |
58 | 0 | return nullptr; |
59 | 0 | } |
60 | 11.9M | return new (t) T(std::forward<Args>(args)...); |
61 | 11.9M | } Unexecuted instantiation: bssl::ECHConfig* bssl::New<bssl::ECHConfig, bssl::ECHConfig>(bssl::ECHConfig&&) bssl::SSLECHKeys* bssl::New<bssl::SSLECHKeys>() Line | Count | Source | 55 | 16.1k | T *New(Args &&...args) { | 56 | 16.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 16.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 16.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 16.1k | } |
bssl::ECHServerConfig* bssl::New<bssl::ECHServerConfig>() Line | Count | Source | 55 | 14.0k | T *New(Args &&...args) { | 56 | 14.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.0k | } |
bssl::SSLPAKEShare* bssl::New<bssl::SSLPAKEShare>() Line | Count | Source | 55 | 42 | T *New(Args &&...args) { | 56 | 42 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 42 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 42 | return new (t) T(std::forward<Args>(args)...); | 61 | 42 | } |
Unexecuted instantiation: bssl::spake2plus::Prover* bssl::New<bssl::spake2plus::Prover>() bssl::SSLCipherPreferenceList* bssl::New<bssl::SSLCipherPreferenceList>() Line | Count | Source | 55 | 21.2k | T *New(Args &&...args) { | 56 | 21.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 21.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 21.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 21.2k | } |
bssl::SSL_HANDSHAKE_HINTS* bssl::New<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 55 | 75.6k | T *New(Args &&...args) { | 56 | 75.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 75.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 75.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 75.6k | } |
bssl::SSL_HANDSHAKE* bssl::New<bssl::SSL_HANDSHAKE, bssl::SSLImpl*&>(bssl::SSLImpl*&) Line | Count | Source | 55 | 98.4k | T *New(Args &&...args) { | 56 | 98.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 98.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 98.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 98.4k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 55 | 117k | T *New(Args &&...args) { | 56 | 117k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117k | return new (t) T(std::forward<Args>(args)...); | 61 | 117k | } |
bssl::SSLAEADContext* bssl::New<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 55 | 138k | T *New(Args &&...args) { | 56 | 138k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 138k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 138k | return new (t) T(std::forward<Args>(args)...); | 61 | 138k | } |
bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 55 | 63.9k | T *New(Args &&...args) { | 56 | 63.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 63.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 63.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 63.9k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
Unexecuted instantiation: bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) bssl::SSLCredential* bssl::New<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::ECKeyShare* bssl::New<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 55 | 14.3k | T *New(Args &&...args) { | 56 | 14.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.3k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519KeyShare* bssl::New<bssl::(anonymous namespace)::X25519KeyShare>() Line | Count | Source | 55 | 86.6k | T *New(Args &&...args) { | 56 | 86.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 86.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 86.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 86.6k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::X25519MLKEM768KeyShare* bssl::New<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>() Line | Count | Source | 55 | 53.2k | T *New(Args &&...args) { | 56 | 53.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 53.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 53.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 53.2k | } |
ssl_key_share.cc:bssl::(anonymous namespace)::MLKEM1024KeyShare* bssl::New<bssl::(anonymous namespace)::MLKEM1024KeyShare>() Line | Count | Source | 55 | 33 | T *New(Args &&...args) { | 56 | 33 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 33 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 33 | return new (t) T(std::forward<Args>(args)...); | 61 | 33 | } |
bssl::SSLContext* bssl::New<bssl::SSLContext, ssl_method_st const*&>(ssl_method_st const*&) Line | Count | Source | 55 | 5.07k | T *New(Args &&...args) { | 56 | 5.07k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.07k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.07k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.07k | } |
bssl::CERT* bssl::New<bssl::CERT, bssl::SSL_X509_METHOD const* const&>(bssl::SSL_X509_METHOD const* const&) Line | Count | Source | 55 | 5.07k | T *New(Args &&...args) { | 56 | 5.07k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.07k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.07k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.07k | } |
bssl::SSLImpl* bssl::New<bssl::SSLImpl, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::SSL_CONFIG* bssl::New<bssl::SSL_CONFIG, bssl::SSLImpl*>(bssl::SSLImpl*&&) Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::TicketKey* bssl::New<bssl::TicketKey>() Line | Count | Source | 55 | 390 | T *New(Args &&...args) { | 56 | 390 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 390 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 390 | return new (t) T(std::forward<Args>(args)...); | 61 | 390 | } |
bssl::SSLSession* bssl::New<bssl::SSLSession, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 55 | 255k | T *New(Args &&...args) { | 56 | 255k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 255k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 255k | return new (t) T(std::forward<Args>(args)...); | 61 | 255k | } |
tls13_enc.cc:bssl::(anonymous namespace)::NullRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 55 | 43.2k | T *New(Args &&...args) { | 56 | 43.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 43.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 43.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 43.2k | } |
Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES128RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::AES256RecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter* bssl::New<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: bssl::spake2plus::Verifier* bssl::New<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >* bssl::New<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter>&&) Line | Count | Source | 55 | 291 | T *New(Args &&...args) { | 56 | 291 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 291 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 291 | return new (t) T(std::forward<Args>(args)...); | 61 | 291 | } |
bssl::DTLSIncomingMessage* bssl::New<bssl::DTLSIncomingMessage, bssl::DTLSHandshakeHeader const&>(bssl::DTLSHandshakeHeader const&) 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 | } |
bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>* bssl::New<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 55 | 10.8k | T *New(Args &&...args) { | 56 | 10.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 10.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 10.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 10.8k | } |
bssl::DTLS1_STATE* bssl::New<bssl::DTLS1_STATE>() Line | Count | Source | 55 | 18.0k | T *New(Args &&...args) { | 56 | 18.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 18.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 18.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 18.0k | } |
bssl::DTLSPrevReadEpoch* bssl::New<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 55 | 33.3k | T *New(Args &&...args) { | 56 | 33.3k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 33.3k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 33.3k | return new (t) T(std::forward<Args>(args)...); | 61 | 33.3k | } |
bssl::SSL3_STATE* bssl::New<bssl::SSL3_STATE>() Line | Count | Source | 55 | 58.8k | T *New(Args &&...args) { | 56 | 58.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 58.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 58.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 58.8k | } |
bssl::EC_WRAPPED_SCALAR* bssl::New<bssl::EC_WRAPPED_SCALAR>() Line | Count | Source | 55 | 3.40k | T *New(Args &&...args) { | 56 | 3.40k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 3.40k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 3.40k | return new (t) T(std::forward<Args>(args)...); | 61 | 3.40k | } |
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 | 350 | T *New(Args &&...args) { | 56 | 350 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 350 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 350 | return new (t) T(std::forward<Args>(args)...); | 61 | 350 | } |
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 | 640k | T *New(Args &&...args) { | 56 | 640k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 640k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 640k | return new (t) T(std::forward<Args>(args)...); | 61 | 640k | } |
bssl::BignumCtx* bssl::New<bssl::BignumCtx>() Line | Count | Source | 55 | 68.9k | T *New(Args &&...args) { | 56 | 68.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 68.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 68.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 68.9k | } |
bn_mont_ctx_st* bssl::New<bn_mont_ctx_st>() Line | Count | Source | 55 | 25.5k | T *New(Args &&...args) { | 56 | 25.5k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 25.5k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 25.5k | return new (t) T(std::forward<Args>(args)...); | 61 | 25.5k | } |
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 | 151k | T *New(Args &&...args) { | 56 | 151k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 151k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 151k | return new (t) T(std::forward<Args>(args)...); | 61 | 151k | } |
bssl::ECKey* bssl::New<bssl::ECKey, engine_st const*&>(engine_st const*&) Line | Count | Source | 55 | 65.6k | T *New(Args &&...args) { | 56 | 65.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 65.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 65.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 65.6k | } |
hmac_ctx_st* bssl::New<hmac_ctx_st>() Line | Count | Source | 55 | 27.2k | T *New(Args &&...args) { | 56 | 27.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 27.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 27.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 27.2k | } |
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 | 298 | T *New(Args &&...args) { | 56 | 298 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 298 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 298 | return new (t) T(std::forward<Args>(args)...); | 61 | 298 | } |
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 | 117 | T *New(Args &&...args) { | 56 | 117 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 117 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 117 | return new (t) T(std::forward<Args>(args)...); | 61 | 117 | } |
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 | 125k | T *New(Args &&...args) { | 56 | 125k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 125k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 125k | return new (t) T(std::forward<Args>(args)...); | 61 | 125k | } |
bssl::Bio* bssl::New<bssl::Bio, bio_method_st const*&>(bio_method_st const*&) Line | Count | Source | 55 | 77.1k | T *New(Args &&...args) { | 56 | 77.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 77.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 77.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 77.1k | } |
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 | 528k | T *New(Args &&...args) { | 56 | 528k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 528k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 528k | return new (t) T(std::forward<Args>(args)...); | 61 | 528k | } |
ecdsa_sig_st* bssl::New<ecdsa_sig_st>() Line | Count | Source | 55 | 21.2k | T *New(Args &&...args) { | 56 | 21.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 21.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 21.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 21.2k | } |
Unexecuted instantiation: engine_st* bssl::New<engine_st>() bssl::EvpPkey* bssl::New<bssl::EvpPkey>() Line | Count | Source | 55 | 269k | T *New(Args &&...args) { | 56 | 269k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 269k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 269k | return new (t) T(std::forward<Args>(args)...); | 61 | 269k | } |
bssl::EvpPkeyCtx* bssl::New<bssl::EvpPkeyCtx>() 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 | } |
Unexecuted instantiation: p_dh.cc:(anonymous namespace)::DH_PKEY_CTX* bssl::New<(anonymous namespace)::DH_PKEY_CTX>() p_ec.cc:(anonymous namespace)::EC_PKEY_CTX* bssl::New<(anonymous namespace)::EC_PKEY_CTX>() Line | Count | Source | 55 | 38.6k | T *New(Args &&...args) { | 56 | 38.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 38.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 38.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 38.6k | } |
p_ed25519.cc:(anonymous namespace)::ED25519_KEY* bssl::New<(anonymous namespace)::ED25519_KEY>() Line | Count | Source | 55 | 281 | T *New(Args &&...args) { | 56 | 281 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 281 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 281 | return new (t) T(std::forward<Args>(args)...); | 61 | 281 | } |
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 | 146 | T *New(Args &&...args) { | 56 | 146 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 146 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 146 | return new (t) T(std::forward<Args>(args)...); | 61 | 146 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 55 | 17 | T *New(Args &&...args) { | 56 | 17 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 17 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 17 | return new (t) T(std::forward<Args>(args)...); | 61 | 17 | } |
Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::MldsaPkeyCtx* bssl::New<(anonymous namespace)::MldsaPkeyCtx>() Unexecuted instantiation: p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>, MLDSA65_public_key const&>(MLDSA65_public_key const&) p_mldsa.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 378 | T *New(Args &&...args) { | 56 | 378 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 378 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 378 | return new (t) T(std::forward<Args>(args)...); | 61 | 378 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 55 | 12 | T *New(Args &&...args) { | 56 | 12 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12 | return new (t) T(std::forward<Args>(args)...); | 61 | 12 | } |
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 | 322 | T *New(Args &&...args) { | 56 | 322 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 322 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 322 | return new (t) T(std::forward<Args>(args)...); | 61 | 322 | } |
p_mldsa.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 55 | 17 | T *New(Args &&...args) { | 56 | 17 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 17 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 17 | return new (t) T(std::forward<Args>(args)...); | 61 | 17 | } |
Unexecuted instantiation: p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>, MLKEM768_public_key const&>(MLKEM768_public_key const&) p_mlkem.cc:(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 96 | T *New(Args &&...args) { | 56 | 96 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 96 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 96 | return new (t) T(std::forward<Args>(args)...); | 61 | 96 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 55 | 238 | T *New(Args &&...args) { | 56 | 238 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 238 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 238 | return new (t) T(std::forward<Args>(args)...); | 61 | 238 | } |
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 | 103 | T *New(Args &&...args) { | 56 | 103 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 103 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 103 | return new (t) T(std::forward<Args>(args)...); | 61 | 103 | } |
p_mlkem.cc:(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>* bssl::New<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>>() Line | Count | Source | 55 | 125 | T *New(Args &&...args) { | 56 | 125 | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 125 | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 125 | return new (t) T(std::forward<Args>(args)...); | 61 | 125 | } |
p_rsa.cc:(anonymous namespace)::RSA_PKEY_CTX* bssl::New<(anonymous namespace)::RSA_PKEY_CTX>() Line | Count | Source | 55 | 83.8k | T *New(Args &&...args) { | 56 | 83.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 83.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 83.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 83.8k | } |
Unexecuted instantiation: p_slhdsa.cc:(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>* bssl::New<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>>() Unexecuted instantiation: p_slhdsa.cc:(anonymous namespace)::SlhdsaPkeyCtx* bssl::New<(anonymous namespace)::SlhdsaPkeyCtx>() Unexecuted instantiation: p_slhdsa.cc:(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>* bssl::New<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>>() Unexecuted instantiation: p_slhdsa.cc:(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>* bssl::New<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>>() p_x25519.cc:(anonymous namespace)::X25519_KEY* bssl::New<(anonymous namespace)::X25519_KEY>() Line | Count | Source | 55 | 14.9k | T *New(Args &&...args) { | 56 | 14.9k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 14.9k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 14.9k | return new (t) T(std::forward<Args>(args)...); | 61 | 14.9k | } |
Unexecuted instantiation: bssl::ExDataFuncs* bssl::New<bssl::ExDataFuncs>() Unexecuted instantiation: evp_hpke_key_st* bssl::New<evp_hpke_key_st>() Unexecuted instantiation: evp_hpke_ctx_st* bssl::New<evp_hpke_ctx_st>() bssl::_LHASH* bssl::New<bssl::_LHASH>() Line | Count | Source | 55 | 30.2k | T *New(Args &&...args) { | 56 | 30.2k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 30.2k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 30.2k | return new (t) T(std::forward<Args>(args)...); | 61 | 30.2k | } |
bssl::LHASH_ITEM* bssl::New<bssl::LHASH_ITEM>() Line | Count | Source | 55 | 88.1k | T *New(Args &&...args) { | 56 | 88.1k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 88.1k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 88.1k | return new (t) T(std::forward<Args>(args)...); | 61 | 88.1k | } |
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 | 364k | T *New(Args &&...args) { | 56 | 364k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 364k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 364k | return new (t) T(std::forward<Args>(args)...); | 61 | 364k | } |
stack_st* bssl::New<stack_st>() Line | Count | Source | 55 | 1.34M | T *New(Args &&...args) { | 56 | 1.34M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.34M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.34M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.34M | } |
Unexecuted instantiation: x509_lookup_st* bssl::New<x509_lookup_st>() bssl::X509Store* bssl::New<bssl::X509Store>() Line | Count | Source | 55 | 5.07k | T *New(Args &&...args) { | 56 | 5.07k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 5.07k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 5.07k | return new (t) T(std::forward<Args>(args)...); | 61 | 5.07k | } |
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.06k | T *New(Args &&...args) { | 56 | 8.06k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 8.06k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 8.06k | return new (t) T(std::forward<Args>(args)...); | 61 | 8.06k | } |
X509_VERIFY_PARAM_st* bssl::New<X509_VERIFY_PARAM_st>() Line | Count | Source | 55 | 77.0k | T *New(Args &&...args) { | 56 | 77.0k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 77.0k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 77.0k | return new (t) T(std::forward<Args>(args)...); | 61 | 77.0k | } |
Unexecuted instantiation: X509_algor_st* bssl::New<X509_algor_st>() bssl::X509NameEntry* bssl::New<bssl::X509NameEntry>() Line | Count | Source | 55 | 949k | T *New(Args &&...args) { | 56 | 949k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 949k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 949k | return new (t) T(std::forward<Args>(args)...); | 61 | 949k | } |
bssl::X509Name* bssl::New<bssl::X509Name>() Line | Count | Source | 55 | 12.4k | T *New(Args &&...args) { | 56 | 12.4k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12.4k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12.4k | return new (t) T(std::forward<Args>(args)...); | 61 | 12.4k | } |
bssl::X509NameCache* bssl::New<bssl::X509NameCache>() Line | Count | Source | 55 | 369k | T *New(Args &&...args) { | 56 | 369k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 369k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 369k | return new (t) T(std::forward<Args>(args)...); | 61 | 369k | } |
Unexecuted instantiation: bssl::X509Pubkey* bssl::New<bssl::X509Pubkey>() bssl::X509Impl* bssl::New<bssl::X509Impl>() Line | Count | Source | 55 | 215k | T *New(Args &&...args) { | 56 | 215k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 215k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 215k | return new (t) T(std::forward<Args>(args)...); | 61 | 215k | } |
asn1_object_st* bssl::New<asn1_object_st>() Line | Count | Source | 55 | 2.10M | T *New(Args &&...args) { | 56 | 2.10M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 2.10M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 2.10M | return new (t) T(std::forward<Args>(args)...); | 61 | 2.10M | } |
Unexecuted instantiation: bssl::ASN1_STRING_TABLE* bssl::New<bssl::ASN1_STRING_TABLE>() asn1_type_st* bssl::New<asn1_type_st>() Line | Count | Source | 55 | 553k | T *New(Args &&...args) { | 56 | 553k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 553k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 553k | return new (t) T(std::forward<Args>(args)...); | 61 | 553k | } |
asn1_string_st* bssl::New<asn1_string_st>() Line | Count | Source | 55 | 1.62M | T *New(Args &&...args) { | 56 | 1.62M | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 1.62M | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 1.62M | return new (t) T(std::forward<Args>(args)...); | 61 | 1.62M | } |
Unexecuted instantiation: evp_encode_ctx_st* bssl::New<evp_encode_ctx_st>() bssl::DSAImpl* bssl::New<bssl::DSAImpl>() Line | Count | Source | 55 | 6.66k | T *New(Args &&...args) { | 56 | 6.66k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 6.66k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 6.66k | return new (t) T(std::forward<Args>(args)...); | 61 | 6.66k | } |
Unexecuted instantiation: DSA_SIG_st* bssl::New<DSA_SIG_st>() Unexecuted instantiation: p_xwing.cc:(anonymous namespace)::XWING_KEY* bssl::New<(anonymous namespace)::XWING_KEY>() Unexecuted instantiation: pkcs12_st* bssl::New<pkcs12_st>() Unexecuted instantiation: by_dir.cc:bssl::(anonymous namespace)::ByDir* bssl::New<bssl::(anonymous namespace)::ByDir>() Unexecuted instantiation: by_dir.cc:bssl::(anonymous namespace)::ByDirEntry* bssl::New<bssl::(anonymous namespace)::ByDirEntry>() bssl::conf_section_st* bssl::New<bssl::conf_section_st>() Line | Count | Source | 55 | 23.8k | T *New(Args &&...args) { | 56 | 23.8k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 23.8k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 23.8k | return new (t) T(std::forward<Args>(args)...); | 61 | 23.8k | } |
conf_st* bssl::New<conf_st>() Line | Count | Source | 55 | 12.6k | T *New(Args &&...args) { | 56 | 12.6k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 12.6k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 12.6k | return new (t) T(std::forward<Args>(args)...); | 61 | 12.6k | } |
conf_value_st* bssl::New<conf_value_st>() Line | Count | Source | 55 | 387k | T *New(Args &&...args) { | 56 | 387k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 387k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 387k | return new (t) T(std::forward<Args>(args)...); | 61 | 387k | } |
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 | 35.7k | T *New(Args &&...args) { | 56 | 35.7k | void *t = OPENSSL_malloc(sizeof(T)); | 57 | 35.7k | if (t == nullptr) { | 58 | 0 | return nullptr; | 59 | 0 | } | 60 | 35.7k | return new (t) T(std::forward<Args>(args)...); | 61 | 35.7k | } |
bssl::DTLSWriteEpoch* bssl::New<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) 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 | } |
|
62 | | |
63 | | // Delete behaves like `delete` but uses `OPENSSL_free` to release memory. |
64 | | // |
65 | | // Note: unlike `delete` this does not support non-public destructors. |
66 | | template <typename T> |
67 | 10.4M | void Delete(T *t) { |
68 | 10.4M | if (t != nullptr) { |
69 | 9.97M | t->~T(); |
70 | 9.97M | OPENSSL_free(t); |
71 | 9.97M | } |
72 | 10.4M | } Unexecuted instantiation: void bssl::Delete<bssl::ECHConfig>(bssl::ECHConfig*) void bssl::Delete<bssl::ECHServerConfig>(bssl::ECHServerConfig*) Line | Count | Source | 67 | 14.0k | void Delete(T *t) { | 68 | 14.0k | if (t != nullptr) { | 69 | 14.0k | t->~T(); | 70 | 14.0k | OPENSSL_free(t); | 71 | 14.0k | } | 72 | 14.0k | } |
void bssl::Delete<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*) Line | Count | Source | 67 | 291 | void Delete(T *t) { | 68 | 291 | if (t != nullptr) { | 69 | 291 | t->~T(); | 70 | 291 | OPENSSL_free(t); | 71 | 291 | } | 72 | 291 | } |
void bssl::Delete<bssl::SSLPAKEShare>(bssl::SSLPAKEShare*) Line | Count | Source | 67 | 42 | void Delete(T *t) { | 68 | 42 | if (t != nullptr) { | 69 | 42 | t->~T(); | 70 | 42 | OPENSSL_free(t); | 71 | 42 | } | 72 | 42 | } |
void bssl::Delete<bssl::SSLKeyShare>(bssl::SSLKeyShare*) Line | Count | Source | 67 | 154k | void Delete(T *t) { | 68 | 154k | if (t != nullptr) { | 69 | 154k | t->~T(); | 70 | 154k | OPENSSL_free(t); | 71 | 154k | } | 72 | 154k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Prover>(bssl::spake2plus::Prover*) void bssl::Delete<bssl::SSLCipherPreferenceList>(bssl::SSLCipherPreferenceList*) Line | Count | Source | 67 | 21.2k | void Delete(T *t) { | 68 | 21.2k | if (t != nullptr) { | 69 | 21.2k | t->~T(); | 70 | 21.2k | OPENSSL_free(t); | 71 | 21.2k | } | 72 | 21.2k | } |
void bssl::Delete<bssl::SSL_HANDSHAKE_HINTS>(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 67 | 75.6k | void Delete(T *t) { | 68 | 75.6k | if (t != nullptr) { | 69 | 75.6k | t->~T(); | 70 | 75.6k | OPENSSL_free(t); | 71 | 75.6k | } | 72 | 75.6k | } |
Unexecuted instantiation: void bssl::Delete<bssl::spake2plus::Verifier>(bssl::spake2plus::Verifier*) void bssl::Delete<bssl::SSL_HANDSHAKE>(bssl::SSL_HANDSHAKE*) Line | Count | Source | 67 | 98.4k | void Delete(T *t) { | 68 | 98.4k | if (t != nullptr) { | 69 | 98.4k | t->~T(); | 70 | 98.4k | OPENSSL_free(t); | 71 | 98.4k | } | 72 | 98.4k | } |
void bssl::Delete<bssl::SSLAEADContext>(bssl::SSLAEADContext*) Line | Count | Source | 67 | 256k | void Delete(T *t) { | 68 | 256k | if (t != nullptr) { | 69 | 256k | t->~T(); | 70 | 256k | OPENSSL_free(t); | 71 | 256k | } | 72 | 256k | } |
void bssl::Delete<bssl::CERT>(bssl::CERT*) Line | Count | Source | 67 | 63.9k | void Delete(T *t) { | 68 | 63.9k | if (t != nullptr) { | 69 | 63.9k | t->~T(); | 70 | 63.9k | OPENSSL_free(t); | 71 | 63.9k | } | 72 | 63.9k | } |
Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::ECKeyShare>(bssl::(anonymous namespace)::ECKeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::X25519KeyShare>(bssl::(anonymous namespace)::X25519KeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::X25519MLKEM768KeyShare>(bssl::(anonymous namespace)::X25519MLKEM768KeyShare*) Unexecuted instantiation: ssl_key_share.cc:void bssl::Delete<bssl::(anonymous namespace)::MLKEM1024KeyShare>(bssl::(anonymous namespace)::MLKEM1024KeyShare*) void bssl::Delete<bssl::SSL_CONFIG>(bssl::SSL_CONFIG*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<bssl::SSLImpl>(bssl::SSLImpl*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<bssl::TicketKey>(bssl::TicketKey*) Line | Count | Source | 67 | 387 | void Delete(T *t) { | 68 | 387 | if (t != nullptr) { | 69 | 387 | t->~T(); | 70 | 387 | OPENSSL_free(t); | 71 | 387 | } | 72 | 387 | } |
void bssl::Delete<bssl::RecordNumberEncrypter>(bssl::RecordNumberEncrypter*) Line | Count | Source | 67 | 43.2k | void Delete(T *t) { | 68 | 43.2k | if (t != nullptr) { | 69 | 43.2k | t->~T(); | 70 | 43.2k | OPENSSL_free(t); | 71 | 43.2k | } | 72 | 43.2k | } |
Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::NullRecordNumberEncrypter>(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:void bssl::Delete<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) void bssl::Delete<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul> >(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 67 | 10.8k | void Delete(T *t) { | 68 | 10.8k | if (t != nullptr) { | 69 | 10.8k | t->~T(); | 70 | 10.8k | OPENSSL_free(t); | 71 | 10.8k | } | 72 | 10.8k | } |
void bssl::Delete<bssl::DTLSIncomingMessage>(bssl::DTLSIncomingMessage*) Line | Count | Source | 67 | 51.6k | void Delete(T *t) { | 68 | 51.6k | if (t != nullptr) { | 69 | 51.6k | t->~T(); | 70 | 51.6k | OPENSSL_free(t); | 71 | 51.6k | } | 72 | 51.6k | } |
void bssl::Delete<bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch*) 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<bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch*) Line | Count | Source | 67 | 35.7k | void Delete(T *t) { | 68 | 35.7k | if (t != nullptr) { | 69 | 35.7k | t->~T(); | 70 | 35.7k | OPENSSL_free(t); | 71 | 35.7k | } | 72 | 35.7k | } |
void bssl::Delete<bssl::DTLSPrevReadEpoch>(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 67 | 33.3k | void Delete(T *t) { | 68 | 33.3k | if (t != nullptr) { | 69 | 33.3k | t->~T(); | 70 | 33.3k | OPENSSL_free(t); | 71 | 33.3k | } | 72 | 33.3k | } |
void bssl::Delete<bssl::DTLS1_STATE>(bssl::DTLS1_STATE*) Line | Count | Source | 67 | 18.0k | void Delete(T *t) { | 68 | 18.0k | if (t != nullptr) { | 69 | 18.0k | t->~T(); | 70 | 18.0k | OPENSSL_free(t); | 71 | 18.0k | } | 72 | 18.0k | } |
void bssl::Delete<bssl::SSL3_STATE>(bssl::SSL3_STATE*) Line | Count | Source | 67 | 58.8k | void Delete(T *t) { | 68 | 58.8k | if (t != nullptr) { | 69 | 58.8k | t->~T(); | 70 | 58.8k | OPENSSL_free(t); | 71 | 58.8k | } | 72 | 58.8k | } |
void bssl::Delete<ec_point_st>(ec_point_st*) Line | Count | Source | 67 | 151k | void Delete(T *t) { | 68 | 151k | if (t != nullptr) { | 69 | 151k | t->~T(); | 70 | 151k | OPENSSL_free(t); | 71 | 151k | } | 72 | 151k | } |
void bssl::Delete<bssl::EC_WRAPPED_SCALAR>(bssl::EC_WRAPPED_SCALAR*) Line | Count | Source | 67 | 69.0k | void Delete(T *t) { | 68 | 69.0k | if (t != nullptr) { | 69 | 3.39k | t->~T(); | 70 | 3.39k | OPENSSL_free(t); | 71 | 3.39k | } | 72 | 69.0k | } |
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 | 350 | void Delete(T *t) { | 68 | 350 | if (t != nullptr) { | 69 | 350 | t->~T(); | 70 | 350 | OPENSSL_free(t); | 71 | 350 | } | 72 | 350 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>(mldsa::(anonymous namespace)::fips::keygen_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::sign_self_test()::Values>(mldsa::(anonymous namespace)::fips::sign_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<6, 5>(mldsa::(anonymous namespace)::public_key<6> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::fips::verify_self_test()::Values>(mldsa::(anonymous namespace)::fips::verify_self_test()::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<(anonymous namespace)::rand_thread_state>((anonymous namespace)::rand_thread_state*) void bssl::Delete<bignum_st>(bignum_st*) Line | Count | Source | 67 | 640k | void Delete(T *t) { | 68 | 640k | if (t != nullptr) { | 69 | 640k | t->~T(); | 70 | 640k | OPENSSL_free(t); | 71 | 640k | } | 72 | 640k | } |
void bssl::Delete<bssl::BignumCtx>(bssl::BignumCtx*) Line | Count | Source | 67 | 68.9k | void Delete(T *t) { | 68 | 68.9k | if (t != nullptr) { | 69 | 68.9k | t->~T(); | 70 | 68.9k | OPENSSL_free(t); | 71 | 68.9k | } | 72 | 68.9k | } |
void bssl::Delete<bn_mont_ctx_st>(bn_mont_ctx_st*) Line | Count | Source | 67 | 25.5k | void Delete(T *t) { | 68 | 25.5k | if (t != nullptr) { | 69 | 25.5k | t->~T(); | 70 | 25.5k | OPENSSL_free(t); | 71 | 25.5k | } | 72 | 25.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 | 27.2k | void Delete(T *t) { | 68 | 27.2k | if (t != nullptr) { | 69 | 27.2k | t->~T(); | 70 | 27.2k | OPENSSL_free(t); | 71 | 27.2k | } | 72 | 27.2k | } |
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 | 298 | void Delete(T *t) { | 68 | 298 | if (t != nullptr) { | 69 | 298 | t->~T(); | 70 | 298 | OPENSSL_free(t); | 71 | 298 | } | 72 | 298 | } |
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 | 117 | void Delete(T *t) { | 68 | 117 | if (t != nullptr) { | 69 | 117 | t->~T(); | 70 | 117 | OPENSSL_free(t); | 71 | 117 | } | 72 | 117 | } |
Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_sign_mu_no_self_test<4, 4>(unsigned char*, mldsa::(anonymous namespace)::private_key<4, 4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: bcm.cc:void bssl::Delete<mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values>(mldsa::(anonymous namespace)::mldsa_verify_mu_no_self_test<4, 4>(mldsa::(anonymous namespace)::public_key<4> const*, unsigned char const*, unsigned char const*)::Values*) Unexecuted instantiation: void bssl::Delete<ctr_drbg_state_st>(ctr_drbg_state_st*) Unexecuted instantiation: void bssl::Delete<bio_method_st>(bio_method_st*) void bssl::Delete<buf_mem_st>(buf_mem_st*) Line | Count | Source | 67 | 452k | void Delete(T *t) { | 68 | 452k | if (t != nullptr) { | 69 | 452k | t->~T(); | 70 | 452k | OPENSSL_free(t); | 71 | 452k | } | 72 | 452k | } |
void bssl::Delete<ecdsa_sig_st>(ecdsa_sig_st*) Line | Count | Source | 67 | 21.2k | void Delete(T *t) { | 68 | 21.2k | if (t != nullptr) { | 69 | 21.2k | t->~T(); | 70 | 21.2k | OPENSSL_free(t); | 71 | 21.2k | } | 72 | 21.2k | } |
Unexecuted instantiation: void bssl::Delete<engine_st>(engine_st*) void bssl::Delete<bssl::EvpPkeyCtx>(bssl::EvpPkeyCtx*) 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: p_dh.cc:void bssl::Delete<(anonymous namespace)::DH_PKEY_CTX>((anonymous namespace)::DH_PKEY_CTX*) p_ec.cc:void bssl::Delete<(anonymous namespace)::EC_PKEY_CTX>((anonymous namespace)::EC_PKEY_CTX*) Line | Count | Source | 67 | 38.6k | void Delete(T *t) { | 68 | 38.6k | if (t != nullptr) { | 69 | 38.6k | t->~T(); | 70 | 38.6k | OPENSSL_free(t); | 71 | 38.6k | } | 72 | 38.6k | } |
p_ed25519.cc:void bssl::Delete<(anonymous namespace)::ED25519_KEY>((anonymous namespace)::ED25519_KEY*) Line | Count | Source | 67 | 281 | void Delete(T *t) { | 68 | 281 | if (t != nullptr) { | 69 | 281 | t->~T(); | 70 | 281 | OPENSSL_free(t); | 71 | 281 | } | 72 | 281 | } |
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 | 146 | void Delete(T *t) { | 68 | 146 | if (t != nullptr) { | 69 | 146 | t->~T(); | 70 | 146 | OPENSSL_free(t); | 71 | 146 | } | 72 | 146 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 67 | 17 | void Delete(T *t) { | 68 | 17 | if (t != nullptr) { | 69 | 17 | t->~T(); | 70 | 17 | OPENSSL_free(t); | 71 | 17 | } | 72 | 17 | } |
Unexecuted instantiation: p_mldsa.cc:void bssl::Delete<(anonymous namespace)::MldsaPkeyCtx>((anonymous namespace)::MldsaPkeyCtx*) p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 378 | void Delete(T *t) { | 68 | 378 | if (t != nullptr) { | 69 | 378 | t->~T(); | 70 | 378 | OPENSSL_free(t); | 71 | 378 | } | 72 | 378 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 67 | 12 | void Delete(T *t) { | 68 | 12 | if (t != nullptr) { | 69 | 12 | t->~T(); | 70 | 12 | OPENSSL_free(t); | 71 | 12 | } | 72 | 12 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 322 | void Delete(T *t) { | 68 | 322 | if (t != nullptr) { | 69 | 322 | t->~T(); | 70 | 322 | OPENSSL_free(t); | 71 | 322 | } | 72 | 322 | } |
p_mldsa.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>*) Line | Count | Source | 67 | 17 | void Delete(T *t) { | 68 | 17 | if (t != nullptr) { | 69 | 17 | t->~T(); | 70 | 17 | OPENSSL_free(t); | 71 | 17 | } | 72 | 17 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 96 | void Delete(T *t) { | 68 | 96 | if (t != nullptr) { | 69 | 96 | t->~T(); | 70 | 96 | OPENSSL_free(t); | 71 | 96 | } | 72 | 96 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM768Traits>*) Line | Count | Source | 67 | 238 | void Delete(T *t) { | 68 | 238 | if (t != nullptr) { | 69 | 238 | t->~T(); | 70 | 238 | OPENSSL_free(t); | 71 | 238 | } | 72 | 238 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 103 | void Delete(T *t) { | 68 | 103 | if (t != nullptr) { | 69 | 103 | t->~T(); | 70 | 103 | OPENSSL_free(t); | 71 | 103 | } | 72 | 103 | } |
p_mlkem.cc:void bssl::Delete<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits> >((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLKEM1024Traits>*) Line | Count | Source | 67 | 125 | void Delete(T *t) { | 68 | 125 | if (t != nullptr) { | 69 | 125 | t->~T(); | 70 | 125 | OPENSSL_free(t); | 71 | 125 | } | 72 | 125 | } |
p_rsa.cc:void bssl::Delete<(anonymous namespace)::RSA_PKEY_CTX>((anonymous namespace)::RSA_PKEY_CTX*) Line | Count | Source | 67 | 83.8k | void Delete(T *t) { | 68 | 83.8k | if (t != nullptr) { | 69 | 83.8k | t->~T(); | 70 | 83.8k | OPENSSL_free(t); | 71 | 83.8k | } | 72 | 83.8k | } |
Unexecuted instantiation: p_slhdsa.cc:void bssl::Delete<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits> >((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>*) Unexecuted instantiation: p_slhdsa.cc:void bssl::Delete<(anonymous namespace)::SlhdsaPkeyCtx>((anonymous namespace)::SlhdsaPkeyCtx*) Unexecuted instantiation: p_slhdsa.cc:void bssl::Delete<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits> >((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>*) Unexecuted instantiation: p_slhdsa.cc:void bssl::Delete<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits> >((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>*) Unexecuted instantiation: void bssl::Delete<evp_hpke_key_st>(evp_hpke_key_st*) Unexecuted instantiation: void bssl::Delete<evp_hpke_ctx_st>(evp_hpke_ctx_st*) void bssl::Delete<bssl::_LHASH>(bssl::_LHASH*) Line | Count | Source | 67 | 30.2k | void Delete(T *t) { | 68 | 30.2k | if (t != nullptr) { | 69 | 30.2k | t->~T(); | 70 | 30.2k | OPENSSL_free(t); | 71 | 30.2k | } | 72 | 30.2k | } |
void bssl::Delete<bssl::LHASH_ITEM>(bssl::LHASH_ITEM*) Line | Count | Source | 67 | 88.1k | void Delete(T *t) { | 68 | 88.1k | if (t != nullptr) { | 69 | 88.1k | t->~T(); | 70 | 88.1k | OPENSSL_free(t); | 71 | 88.1k | } | 72 | 88.1k | } |
void bssl::Delete<stack_st>(stack_st*) Line | Count | Source | 67 | 1.34M | void Delete(T *t) { | 68 | 1.34M | if (t != nullptr) { | 69 | 1.34M | t->~T(); | 70 | 1.34M | OPENSSL_free(t); | 71 | 1.34M | } | 72 | 1.34M | } |
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.06k | void Delete(T *t) { | 68 | 8.06k | if (t != nullptr) { | 69 | 8.06k | t->~T(); | 70 | 8.06k | OPENSSL_free(t); | 71 | 8.06k | } | 72 | 8.06k | } |
void bssl::Delete<X509_VERIFY_PARAM_st>(X509_VERIFY_PARAM_st*) Line | Count | Source | 67 | 77.0k | void Delete(T *t) { | 68 | 77.0k | if (t != nullptr) { | 69 | 77.0k | t->~T(); | 70 | 77.0k | OPENSSL_free(t); | 71 | 77.0k | } | 72 | 77.0k | } |
void bssl::Delete<bssl::X509NameEntry>(bssl::X509NameEntry*) Line | Count | Source | 67 | 949k | void Delete(T *t) { | 68 | 949k | if (t != nullptr) { | 69 | 949k | t->~T(); | 70 | 949k | OPENSSL_free(t); | 71 | 949k | } | 72 | 949k | } |
void bssl::Delete<bssl::X509NameCache>(bssl::X509NameCache*) Line | Count | Source | 67 | 823k | void Delete(T *t) { | 68 | 823k | if (t != nullptr) { | 69 | 369k | t->~T(); | 70 | 369k | OPENSSL_free(t); | 71 | 369k | } | 72 | 823k | } |
void bssl::Delete<bssl::X509Name>(bssl::X509Name*) Line | Count | Source | 67 | 15.7k | void Delete(T *t) { | 68 | 15.7k | if (t != nullptr) { | 69 | 12.4k | t->~T(); | 70 | 12.4k | OPENSSL_free(t); | 71 | 12.4k | } | 72 | 15.7k | } |
Unexecuted instantiation: void bssl::Delete<bssl::X509Pubkey>(bssl::X509Pubkey*) void bssl::Delete<asn1_object_st>(asn1_object_st*) Line | Count | Source | 67 | 2.10M | void Delete(T *t) { | 68 | 2.10M | if (t != nullptr) { | 69 | 2.10M | t->~T(); | 70 | 2.10M | OPENSSL_free(t); | 71 | 2.10M | } | 72 | 2.10M | } |
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 | 553k | void Delete(T *t) { | 68 | 553k | if (t != nullptr) { | 69 | 553k | t->~T(); | 70 | 553k | OPENSSL_free(t); | 71 | 553k | } | 72 | 553k | } |
void bssl::Delete<asn1_string_st>(asn1_string_st*) Line | Count | Source | 67 | 1.62M | void Delete(T *t) { | 68 | 1.62M | if (t != nullptr) { | 69 | 1.62M | t->~T(); | 70 | 1.62M | OPENSSL_free(t); | 71 | 1.62M | } | 72 | 1.62M | } |
Unexecuted instantiation: void bssl::Delete<evp_encode_ctx_st>(evp_encode_ctx_st*) Unexecuted instantiation: void bssl::Delete<DSA_SIG_st>(DSA_SIG_st*) Unexecuted instantiation: p_xwing.cc:void bssl::Delete<(anonymous namespace)::XWING_KEY>((anonymous namespace)::XWING_KEY*) Unexecuted instantiation: void bssl::Delete<pkcs12_st>(pkcs12_st*) Unexecuted instantiation: by_dir.cc:void bssl::Delete<bssl::(anonymous namespace)::ByDir>(bssl::(anonymous namespace)::ByDir*) Unexecuted instantiation: by_dir.cc:void bssl::Delete<bssl::(anonymous namespace)::ByDirEntry>(bssl::(anonymous namespace)::ByDirEntry*) void bssl::Delete<bssl::conf_section_st>(bssl::conf_section_st*) Line | Count | Source | 67 | 23.8k | void Delete(T *t) { | 68 | 23.8k | if (t != nullptr) { | 69 | 23.8k | t->~T(); | 70 | 23.8k | OPENSSL_free(t); | 71 | 23.8k | } | 72 | 23.8k | } |
void bssl::Delete<conf_value_st>(conf_value_st*) Line | Count | Source | 67 | 59.7k | void Delete(T *t) { | 68 | 59.7k | if (t != nullptr) { | 69 | 59.7k | t->~T(); | 70 | 59.7k | OPENSSL_free(t); | 71 | 59.7k | } | 72 | 59.7k | } |
void bssl::Delete<conf_st>(conf_st*) Line | Count | Source | 67 | 12.6k | void Delete(T *t) { | 68 | 12.6k | if (t != nullptr) { | 69 | 12.6k | t->~T(); | 70 | 12.6k | OPENSSL_free(t); | 71 | 12.6k | } | 72 | 12.6k | } |
void bssl::Delete<char>(char*) Line | Count | Source | 67 | 12.6k | void Delete(T *t) { | 68 | 12.6k | if (t != nullptr) { | 69 | 12.6k | t->~T(); | 70 | 12.6k | OPENSSL_free(t); | 71 | 12.6k | } | 72 | 12.6k | } |
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 | 928k | 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 | 14.0k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLPAKEShare, void>::Free(bssl::SSLPAKEShare*) Line | Count | Source | 82 | 42 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLKeyShare, void>::Free(bssl::SSLKeyShare*) Line | Count | Source | 82 | 154k | 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 | 21.2k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE_HINTS, void>::Free(bssl::SSL_HANDSHAKE_HINTS*) Line | Count | Source | 82 | 75.6k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::spake2plus::Verifier, void>::Free(bssl::spake2plus::Verifier*) bssl::internal::DeleterImpl<bssl::SSL_HANDSHAKE, void>::Free(bssl::SSL_HANDSHAKE*) Line | Count | Source | 82 | 98.4k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::SSLAEADContext, void>::Free(bssl::SSLAEADContext*) Line | Count | Source | 82 | 256k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::CERT, void>::Free(bssl::CERT*) Line | Count | Source | 82 | 63.9k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ECKeyShare, void>::Free(bssl::(anonymous namespace)::ECKeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::X25519KeyShare, void>::Free(bssl::(anonymous namespace)::X25519KeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::X25519MLKEM768KeyShare, void>::Free(bssl::(anonymous namespace)::X25519MLKEM768KeyShare*) Unexecuted instantiation: ssl_key_share.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::MLKEM1024KeyShare, void>::Free(bssl::(anonymous namespace)::MLKEM1024KeyShare*) bssl::internal::DeleterImpl<bssl::SSL_CONFIG, void>::Free(bssl::SSL_CONFIG*) Line | Count | Source | 82 | 58.8k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::SSLImpl, void>::Free(bssl::SSLImpl*) bssl::internal::DeleterImpl<bssl::TicketKey, void>::Free(bssl::TicketKey*) Line | Count | Source | 82 | 387 | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::RecordNumberEncrypter, void>::Free(bssl::RecordNumberEncrypter*) Line | Count | Source | 82 | 43.2k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::NullRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::NullRecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES128RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::AES256RecordNumberEncrypter*) Unexecuted instantiation: tls13_enc.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, void>::Free(bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter*) bssl::internal::DeleterImpl<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, void>::Free(bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>*) Line | Count | Source | 82 | 10.8k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSIncomingMessage, void>::Free(bssl::DTLSIncomingMessage*) Line | Count | Source | 82 | 51.6k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSWriteEpoch, void>::Free(bssl::DTLSWriteEpoch*) Line | Count | Source | 82 | 8.16k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSReadEpoch, void>::Free(bssl::DTLSReadEpoch*) Line | Count | Source | 82 | 35.7k | static void Free(T *t) { Delete(t); } |
bssl::internal::DeleterImpl<bssl::DTLSPrevReadEpoch, void>::Free(bssl::DTLSPrevReadEpoch*) Line | Count | Source | 82 | 33.3k | 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 | 350 | 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 | 298 | 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 | 117 | 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 | 29 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, void>::Free((anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>*) Line | Count | Source | 82 | 13 | static void Free(T *t) { Delete(t); } |
p_mldsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, void>::Free((anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>*) Line | Count | Source | 82 | 28 | 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 | 24 | 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 | 14 | 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 | 28 | 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 | 121 | 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 | 83 | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: p_slhdsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>, void>::Free((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>*) Unexecuted instantiation: p_slhdsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>, void>::Free((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>*) Unexecuted instantiation: p_slhdsa.cc:bssl::internal::DeleterImpl<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>, void>::Free((anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>*) bssl::internal::DeleterImpl<bssl::X509NameEntry, void>::Free(bssl::X509NameEntry*) Line | Count | Source | 82 | 1.19k | static void Free(T *t) { Delete(t); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509NameCache, void>::Free(bssl::X509NameCache*) Unexecuted instantiation: p_xwing.cc:bssl::internal::DeleterImpl<(anonymous namespace)::XWING_KEY, void>::Free((anonymous namespace)::XWING_KEY*) Unexecuted instantiation: by_dir.cc:bssl::internal::DeleterImpl<bssl::(anonymous namespace)::ByDirEntry, void>::Free(bssl::(anonymous namespace)::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 | 757k | static void Free(T *t) { t->DecRefInternal(); }bssl::internal::DeleterImpl<bssl::SSLECHKeys, void>::Free(bssl::SSLECHKeys*) Line | Count | Source | 89 | 401 | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLCredential, void>::Free(bssl::SSLCredential*) Line | Count | Source | 89 | 143k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLSession, void>::Free(bssl::SSLSession*) Line | Count | Source | 89 | 243k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::SSLContext, void>::Free(bssl::SSLContext*) Line | Count | Source | 89 | 117k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::RSAImpl, void>::Free(bssl::RSAImpl*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::ECCustomGroup, void>::Free(bssl::ECCustomGroup*) bssl::internal::DeleterImpl<bssl::ECKey, void>::Free(bssl::ECKey*) Line | Count | Source | 89 | 2.56k | 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 | 227k | static void Free(T *t) { t->DecRefInternal(); } |
bssl::internal::DeleterImpl<bssl::DSAImpl, void>::Free(bssl::DSAImpl*) Line | Count | Source | 89 | 5.77k | static void Free(T *t) { t->DecRefInternal(); } |
Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPoolHandle, void>::Free(bssl::CryptoBufferPoolHandle*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBufferPool, void>::Free(bssl::CryptoBufferPool*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::CryptoBuffer, void>::Free(bssl::CryptoBuffer*) Unexecuted instantiation: bssl::internal::DeleterImpl<bssl::X509Store, void>::Free(bssl::X509Store*) bssl::internal::DeleterImpl<bssl::X509Impl, void>::Free(bssl::X509Impl*) Line | Count | Source | 89 | 16.1k | 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 | 453k | inline UniquePtr<T> UpRef(const T *v) { |
99 | 453k | if (v != nullptr) { |
100 | 390k | v->UpRefInternal(); |
101 | 390k | } |
102 | 453k | return UniquePtr<T>(const_cast<T *>(v)); |
103 | 453k | } std::__1::unique_ptr<bssl::SSLECHKeys, bssl::internal::Deleter> bssl::UpRef<bssl::SSLECHKeys, void>(bssl::SSLECHKeys const*) Line | Count | Source | 98 | 407 | inline UniquePtr<T> UpRef(const T *v) { | 99 | 407 | if (v != nullptr) { | 100 | 407 | v->UpRefInternal(); | 101 | 407 | } | 102 | 407 | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 407 | } |
std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::UpRef<bssl::SSLSession, void>(bssl::SSLSession const*) Line | Count | Source | 98 | 129k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 129k | if (v != nullptr) { | 100 | 128k | v->UpRefInternal(); | 101 | 128k | } | 102 | 129k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 129k | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::UpRef<bssl::SSLCredential, void>(bssl::SSLCredential const*) Line | Count | Source | 98 | 20.8k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 20.8k | if (v != nullptr) { | 100 | 20.8k | v->UpRefInternal(); | 101 | 20.8k | } | 102 | 20.8k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 20.8k | } |
std::__1::unique_ptr<bssl::SSLContext, bssl::internal::Deleter> bssl::UpRef<bssl::SSLContext, void>(bssl::SSLContext const*) Line | Count | Source | 98 | 117k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 117k | if (v != nullptr) { | 100 | 117k | v->UpRefInternal(); | 101 | 117k | } | 102 | 117k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 117k | } |
std::__1::unique_ptr<bssl::EvpPkey, bssl::internal::Deleter> bssl::UpRef<bssl::EvpPkey, void>(bssl::EvpPkey const*) Line | Count | Source | 98 | 184k | inline UniquePtr<T> UpRef(const T *v) { | 99 | 184k | if (v != nullptr) { | 100 | 123k | v->UpRefInternal(); | 101 | 123k | } | 102 | 184k | return UniquePtr<T>(const_cast<T *>(v)); | 103 | 184k | } |
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 | 123k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { |
106 | 123k | return UpRef(ptr.get()); |
107 | 123k | } std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::UpRef<bssl::SSLSession, void>(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> const&) Line | Count | Source | 105 | 612 | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 612 | return UpRef(ptr.get()); | 107 | 612 | } |
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 | 401 | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 401 | return UpRef(ptr.get()); | 107 | 401 | } |
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 | 122k | inline UniquePtr<T> UpRef(const UniquePtr<T> &ptr) { | 106 | 122k | return UpRef(ptr.get()); | 107 | 122k | } |
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.23M | UniquePtr<T> MakeUnique(Args &&...args) { |
113 | 3.23M | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); |
114 | 3.23M | } 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 | 14.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 14.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 14.0k | } |
std::__1::unique_ptr<bssl::SSLPAKEShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLPAKEShare>() Line | Count | Source | 112 | 42 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 42 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 42 | } |
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 | 21.2k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 21.2k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 21.2k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE_HINTS, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE_HINTS>() Line | Count | Source | 112 | 75.6k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 75.6k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 75.6k | } |
std::__1::unique_ptr<bssl::SSL_HANDSHAKE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_HANDSHAKE, bssl::SSLImpl*&>(bssl::SSLImpl*&) Line | Count | Source | 112 | 98.4k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 98.4k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 98.4k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, decltype(nullptr)>(decltype(nullptr)&&) Line | Count | Source | 112 | 117k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117k | } |
std::__1::unique_ptr<bssl::SSLAEADContext, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLAEADContext, ssl_cipher_st const*&>(ssl_cipher_st const*&) Line | Count | Source | 112 | 138k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 138k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 138k | } |
std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType>(bssl::SSLCredentialType&&) Line | Count | Source | 112 | 63.9k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 63.9k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 63.9k | } |
std::__1::unique_ptr<bssl::CERT, bssl::internal::Deleter> bssl::MakeUnique<bssl::CERT, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
Unexecuted instantiation: std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType&>(bssl::SSLCredentialType&) std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLCredential, bssl::SSLCredentialType const&>(bssl::SSLCredentialType const&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
ssl_key_share.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ECKeyShare, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ECKeyShare, ec_group_st const*, int>(ec_group_st const*&&, int&&) Line | Count | Source | 112 | 14.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 14.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 14.3k | } |
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 | 86.6k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 86.6k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 86.6k | } |
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 | 53.2k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 53.2k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 53.2k | } |
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 | 33 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 33 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 33 | } |
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.07k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 5.07k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 5.07k | } |
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.07k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 5.07k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 5.07k | } |
std::__1::unique_ptr<bssl::SSLImpl, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLImpl, bssl::SSLContext*&>(bssl::SSLContext*&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
std::__1::unique_ptr<bssl::SSL_CONFIG, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL_CONFIG, bssl::SSLImpl*>(bssl::SSLImpl*&&) Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
std::__1::unique_ptr<bssl::TicketKey, bssl::internal::Deleter> bssl::MakeUnique<bssl::TicketKey>() Line | Count | Source | 112 | 390 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 390 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 390 | } |
std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSLSession, bssl::SSL_X509_METHOD const*&>(bssl::SSL_X509_METHOD const*&) Line | Count | Source | 112 | 255k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 255k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 255k | } |
tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::NullRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::NullRecordNumberEncrypter>() Line | Count | Source | 112 | 43.2k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 43.2k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 43.2k | } |
Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES128RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES128RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::AES256RecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::AES256RecordNumberEncrypter>() Unexecuted instantiation: tls13_enc.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter>() Unexecuted instantiation: std::__1::unique_ptr<bssl::spake2plus::Verifier, bssl::internal::Deleter> bssl::MakeUnique<bssl::spake2plus::Verifier>() Unexecuted instantiation: std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::SSLImportedPSK>(bssl::SSLImportedPSK&&) std::__1::unique_ptr<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, bssl::internal::Deleter> bssl::MakeUnique<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >(std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter>&&) Line | Count | Source | 112 | 291 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 291 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 291 | } |
std::__1::unique_ptr<bssl::DTLSIncomingMessage, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSIncomingMessage, bssl::DTLSHandshakeHeader const&>(bssl::DTLSHandshakeHeader const&) 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 | } |
std::__1::unique_ptr<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>, bssl::internal::Deleter> bssl::MakeUnique<bssl::MRUQueue<bssl::DTLSSentRecord, 32ul>>() Line | Count | Source | 112 | 10.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 10.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 10.8k | } |
std::__1::unique_ptr<bssl::DTLS1_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLS1_STATE>() Line | Count | Source | 112 | 18.0k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 18.0k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 18.0k | } |
std::__1::unique_ptr<bssl::DTLSPrevReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSPrevReadEpoch>() Line | Count | Source | 112 | 33.3k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 33.3k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 33.3k | } |
std::__1::unique_ptr<bssl::SSL3_STATE, bssl::internal::Deleter> bssl::MakeUnique<bssl::SSL3_STATE>() Line | Count | Source | 112 | 58.8k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 58.8k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 58.8k | } |
Unexecuted instantiation: bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::fips::keygen_self_test()::Values>() bcm.cc:std::__1::unique_ptr<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values, bssl::internal::Deleter> bssl::MakeUnique<mldsa::(anonymous namespace)::mldsa_finish_keygen<6, 5>(unsigned char*, mldsa::(anonymous namespace)::private_key<6, 5>*)::Values>() Line | Count | Source | 112 | 350 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 350 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 350 | } |
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 | 298 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 298 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 298 | } |
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 | 117 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 117 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 117 | } |
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 | 122k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 122k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 122k | } |
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 | 146 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 146 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 146 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA44Traits>>() Line | Count | Source | 112 | 17 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 17 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 17 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLDSA65Traits>>() Line | Count | Source | 112 | 378 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 378 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 378 | } |
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 | 12 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 12 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 12 | } |
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 | 322 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 322 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 322 | } |
p_mldsa.cc:std::__1::unique_ptr<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PublicKeyData<(anonymous namespace)::MLDSA87Traits>>() Line | Count | Source | 112 | 17 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 17 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 17 | } |
p_mlkem.cc:std::__1::unique_ptr<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::PrivateKeyData<(anonymous namespace)::MLKEM768Traits>>() Line | Count | Source | 112 | 96 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 96 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 96 | } |
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 | 238 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 238 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 238 | } |
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 | 103 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 103 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 103 | } |
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 | 125 | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 125 | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 125 | } |
Unexecuted instantiation: p_slhdsa.cc:std::__1::unique_ptr<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128STraits>>() Unexecuted instantiation: p_slhdsa.cc:std::__1::unique_ptr<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHAKE_256FTraits>>() Unexecuted instantiation: p_slhdsa.cc:std::__1::unique_ptr<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::SLHDSA_KEY<(anonymous namespace)::SLHDSASHA2_128SWithSHA256Traits>>() 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 | 364k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 364k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 364k | } |
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 | 925k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 925k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 925k | } |
std::__1::unique_ptr<bssl::X509NameCache, bssl::internal::Deleter> bssl::MakeUnique<bssl::X509NameCache>() Line | Count | Source | 112 | 369k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 369k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 369k | } |
Unexecuted instantiation: p_xwing.cc:std::__1::unique_ptr<(anonymous namespace)::XWING_KEY, bssl::internal::Deleter> bssl::MakeUnique<(anonymous namespace)::XWING_KEY>() Unexecuted instantiation: by_dir.cc:std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> bssl::MakeUnique<bssl::(anonymous namespace)::ByDirEntry>() std::__1::unique_ptr<bssl::DTLSReadEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSReadEpoch, bssl::DTLSReadEpoch>(bssl::DTLSReadEpoch&&) Line | Count | Source | 112 | 35.7k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 35.7k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 35.7k | } |
std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter> bssl::MakeUnique<bssl::DTLSWriteEpoch, bssl::DTLSWriteEpoch>(bssl::DTLSWriteEpoch&&) Line | Count | Source | 112 | 8.16k | UniquePtr<T> MakeUnique(Args &&...args) { | 113 | 8.16k | return UniquePtr<T>(New<T>(std::forward<Args>(args)...)); | 114 | 8.16k | } |
|
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 | 795k | void UpRefInternal() const { |
134 | | // Safety: the following call does not mutate anything other than the atomic |
135 | | // ref-count variable. |
136 | 795k | CRYPTO_refcount_inc(&references_); |
137 | 795k | } bssl::RefCounted<bssl::SSLECHKeys>::UpRefInternal() const Line | Count | Source | 133 | 407 | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 407 | CRYPTO_refcount_inc(&references_); | 137 | 407 | } |
bssl::RefCounted<bssl::SSLSession>::UpRefInternal() const Line | Count | Source | 133 | 128k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 128k | CRYPTO_refcount_inc(&references_); | 137 | 128k | } |
bssl::RefCounted<bssl::SSLCredential>::UpRefInternal() const Line | Count | Source | 133 | 20.8k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 20.8k | CRYPTO_refcount_inc(&references_); | 137 | 20.8k | } |
bssl::RefCounted<bssl::SSLContext>::UpRefInternal() const Line | Count | Source | 133 | 117k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 117k | CRYPTO_refcount_inc(&references_); | 137 | 117k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::RSAImpl>::UpRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::Bio>::UpRefInternal() const bssl::RefCounted<bssl::EvpPkey>::UpRefInternal() const Line | Count | Source | 133 | 294k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 294k | CRYPTO_refcount_inc(&references_); | 137 | 294k | } |
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 | 233k | void UpRefInternal() const { | 134 | | // Safety: the following call does not mutate anything other than the atomic | 135 | | // ref-count variable. | 136 | 233k | CRYPTO_refcount_inc(&references_); | 137 | 233k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::UpRefInternal() const |
138 | | |
139 | | // Only the implementations of `FOO_dup_ref` should call these. |
140 | 403k | Derived *DupRefInternal() const { |
141 | 403k | UpRefInternal(); |
142 | 403k | return const_cast<Derived *>(static_cast<const Derived *>(this)); |
143 | 403k | } Unexecuted instantiation: bssl::RefCounted<bssl::SSLECHKeys>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLCredential>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLContext>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::SSLSession>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::ECKey>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::RSAImpl>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::Bio>::DupRefInternal() const bssl::RefCounted<bssl::EvpPkey>::DupRefInternal() const Line | Count | Source | 140 | 170k | Derived *DupRefInternal() const { | 141 | 170k | UpRefInternal(); | 142 | 170k | return const_cast<Derived *>(static_cast<const Derived *>(this)); | 143 | 170k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::DupRefInternal() const Unexecuted instantiation: bssl::RefCounted<bssl::X509Store>::DupRefInternal() const bssl::RefCounted<bssl::X509Impl>::DupRefInternal() const Line | Count | Source | 140 | 233k | Derived *DupRefInternal() const { | 141 | 233k | UpRefInternal(); | 142 | 233k | return const_cast<Derived *>(static_cast<const Derived *>(this)); | 143 | 233k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DSAImpl>::DupRefInternal() const |
144 | | |
145 | 1.95M | bool DecRefInternal() { |
146 | 1.95M | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { |
147 | 1.16M | Derived *d = static_cast<Derived *>(this); |
148 | 1.16M | d->~Derived(); |
149 | 1.16M | OPENSSL_free(d); |
150 | 1.16M | return true; |
151 | 1.16M | } |
152 | 795k | return false; |
153 | 1.95M | } bssl::RefCounted<bssl::SSLECHKeys>::DecRefInternal() Line | Count | Source | 145 | 16.5k | bool DecRefInternal() { | 146 | 16.5k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 16.1k | Derived *d = static_cast<Derived *>(this); | 148 | 16.1k | d->~Derived(); | 149 | 16.1k | OPENSSL_free(d); | 150 | 16.1k | return true; | 151 | 16.1k | } | 152 | 407 | return false; | 153 | 16.5k | } |
bssl::RefCounted<bssl::SSLCredential>::DecRefInternal() Line | Count | Source | 145 | 143k | bool DecRefInternal() { | 146 | 143k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 122k | Derived *d = static_cast<Derived *>(this); | 148 | 122k | d->~Derived(); | 149 | 122k | OPENSSL_free(d); | 150 | 122k | return true; | 151 | 122k | } | 152 | 20.8k | return false; | 153 | 143k | } |
bssl::RefCounted<bssl::SSLSession>::DecRefInternal() Line | Count | Source | 145 | 384k | bool DecRefInternal() { | 146 | 384k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 255k | Derived *d = static_cast<Derived *>(this); | 148 | 255k | d->~Derived(); | 149 | 255k | OPENSSL_free(d); | 150 | 255k | return true; | 151 | 255k | } | 152 | 128k | return false; | 153 | 384k | } |
bssl::RefCounted<bssl::SSLContext>::DecRefInternal() Line | Count | Source | 145 | 122k | bool DecRefInternal() { | 146 | 122k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 5.06k | Derived *d = static_cast<Derived *>(this); | 148 | 5.06k | d->~Derived(); | 149 | 5.06k | OPENSSL_free(d); | 150 | 5.06k | return true; | 151 | 5.06k | } | 152 | 117k | return false; | 153 | 122k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::DecRefInternal() bssl::RefCounted<bssl::ECKey>::DecRefInternal() Line | Count | Source | 145 | 65.6k | bool DecRefInternal() { | 146 | 65.6k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 65.6k | Derived *d = static_cast<Derived *>(this); | 148 | 65.6k | d->~Derived(); | 149 | 65.6k | OPENSSL_free(d); | 150 | 65.6k | return true; | 151 | 65.6k | } | 152 | 0 | return false; | 153 | 65.6k | } |
bssl::RefCounted<bssl::RSAImpl>::DecRefInternal() Line | Count | Source | 145 | 125k | bool DecRefInternal() { | 146 | 125k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 125k | Derived *d = static_cast<Derived *>(this); | 148 | 125k | d->~Derived(); | 149 | 125k | OPENSSL_free(d); | 150 | 125k | return true; | 151 | 125k | } | 152 | 0 | return false; | 153 | 125k | } |
bssl::RefCounted<bssl::Bio>::DecRefInternal() Line | Count | Source | 145 | 77.1k | bool DecRefInternal() { | 146 | 77.1k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 77.1k | Derived *d = static_cast<Derived *>(this); | 148 | 77.1k | d->~Derived(); | 149 | 77.1k | OPENSSL_free(d); | 150 | 77.1k | return true; | 151 | 77.1k | } | 152 | 0 | return false; | 153 | 77.1k | } |
bssl::RefCounted<bssl::EvpPkey>::DecRefInternal() Line | Count | Source | 145 | 563k | bool DecRefInternal() { | 146 | 563k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 269k | Derived *d = static_cast<Derived *>(this); | 148 | 269k | d->~Derived(); | 149 | 269k | OPENSSL_free(d); | 150 | 269k | return true; | 151 | 269k | } | 152 | 294k | return false; | 153 | 563k | } |
bssl::RefCounted<bssl::DSAImpl>::DecRefInternal() Line | Count | Source | 145 | 6.66k | bool DecRefInternal() { | 146 | 6.66k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 6.66k | Derived *d = static_cast<Derived *>(this); | 148 | 6.66k | d->~Derived(); | 149 | 6.66k | OPENSSL_free(d); | 150 | 6.66k | return true; | 151 | 6.66k | } | 152 | 0 | return false; | 153 | 6.66k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::DecRefInternal() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::DecRefInternal() bssl::RefCounted<bssl::X509Store>::DecRefInternal() Line | Count | Source | 145 | 5.06k | bool DecRefInternal() { | 146 | 5.06k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 5.06k | Derived *d = static_cast<Derived *>(this); | 148 | 5.06k | d->~Derived(); | 149 | 5.06k | OPENSSL_free(d); | 150 | 5.06k | return true; | 151 | 5.06k | } | 152 | 0 | return false; | 153 | 5.06k | } |
bssl::RefCounted<bssl::X509Impl>::DecRefInternal() Line | Count | Source | 145 | 448k | bool DecRefInternal() { | 146 | 448k | if (CRYPTO_refcount_dec_and_test_zero(&references_)) { | 147 | 215k | Derived *d = static_cast<Derived *>(this); | 148 | 215k | d->~Derived(); | 149 | 215k | OPENSSL_free(d); | 150 | 215k | return true; | 151 | 215k | } | 152 | 233k | return false; | 153 | 448k | } |
|
154 | | |
155 | | protected: |
156 | | // Ensure that only `Derived`, which must inherit from `RefCounted<Derived>`, |
157 | | // can call the constructor. This catches bugs where someone inherited from |
158 | | // the wrong base. |
159 | | class CheckSubClass { |
160 | | private: |
161 | | friend Derived; |
162 | | CheckSubClass() = default; |
163 | | }; |
164 | 1.16M | RefCounted(CheckSubClass) { |
165 | 1.16M | static_assert(std::is_base_of_v<RefCounted, Derived>, |
166 | 1.16M | "Derived must subclass RefCounted<Derived>"); |
167 | 1.16M | } bssl::RefCounted<bssl::SSLECHKeys>::RefCounted(bssl::RefCounted<bssl::SSLECHKeys>::CheckSubClass) Line | Count | Source | 164 | 16.1k | RefCounted(CheckSubClass) { | 165 | 16.1k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 16.1k | "Derived must subclass RefCounted<Derived>"); | 167 | 16.1k | } |
bssl::RefCounted<bssl::SSLCredential>::RefCounted(bssl::RefCounted<bssl::SSLCredential>::CheckSubClass) Line | Count | Source | 164 | 122k | RefCounted(CheckSubClass) { | 165 | 122k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 122k | "Derived must subclass RefCounted<Derived>"); | 167 | 122k | } |
bssl::RefCounted<bssl::SSLContext>::RefCounted(bssl::RefCounted<bssl::SSLContext>::CheckSubClass) Line | Count | Source | 164 | 5.07k | RefCounted(CheckSubClass) { | 165 | 5.07k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 5.07k | "Derived must subclass RefCounted<Derived>"); | 167 | 5.07k | } |
bssl::RefCounted<bssl::SSLSession>::RefCounted(bssl::RefCounted<bssl::SSLSession>::CheckSubClass) Line | Count | Source | 164 | 255k | RefCounted(CheckSubClass) { | 165 | 255k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 255k | "Derived must subclass RefCounted<Derived>"); | 167 | 255k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::RefCounted(bssl::RefCounted<bssl::DHImpl>::CheckSubClass) Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::RefCounted(bssl::RefCounted<bssl::ECCustomGroup>::CheckSubClass) bssl::RefCounted<bssl::ECKey>::RefCounted(bssl::RefCounted<bssl::ECKey>::CheckSubClass) Line | Count | Source | 164 | 65.6k | RefCounted(CheckSubClass) { | 165 | 65.6k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 65.6k | "Derived must subclass RefCounted<Derived>"); | 167 | 65.6k | } |
bssl::RefCounted<bssl::RSAImpl>::RefCounted(bssl::RefCounted<bssl::RSAImpl>::CheckSubClass) Line | Count | Source | 164 | 125k | RefCounted(CheckSubClass) { | 165 | 125k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 125k | "Derived must subclass RefCounted<Derived>"); | 167 | 125k | } |
bssl::RefCounted<bssl::Bio>::RefCounted(bssl::RefCounted<bssl::Bio>::CheckSubClass) Line | Count | Source | 164 | 77.1k | RefCounted(CheckSubClass) { | 165 | 77.1k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 77.1k | "Derived must subclass RefCounted<Derived>"); | 167 | 77.1k | } |
bssl::RefCounted<bssl::EvpPkey>::RefCounted(bssl::RefCounted<bssl::EvpPkey>::CheckSubClass) Line | Count | Source | 164 | 269k | RefCounted(CheckSubClass) { | 165 | 269k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 269k | "Derived must subclass RefCounted<Derived>"); | 167 | 269k | } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPool>::CheckSubClass) Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::RefCounted(bssl::RefCounted<bssl::CryptoBufferPoolHandle>::CheckSubClass) bssl::RefCounted<bssl::X509Store>::RefCounted(bssl::RefCounted<bssl::X509Store>::CheckSubClass) Line | Count | Source | 164 | 5.07k | RefCounted(CheckSubClass) { | 165 | 5.07k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 5.07k | "Derived must subclass RefCounted<Derived>"); | 167 | 5.07k | } |
bssl::RefCounted<bssl::X509Impl>::RefCounted(bssl::RefCounted<bssl::X509Impl>::CheckSubClass) Line | Count | Source | 164 | 215k | RefCounted(CheckSubClass) { | 165 | 215k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 215k | "Derived must subclass RefCounted<Derived>"); | 167 | 215k | } |
bssl::RefCounted<bssl::DSAImpl>::RefCounted(bssl::RefCounted<bssl::DSAImpl>::CheckSubClass) Line | Count | Source | 164 | 6.66k | RefCounted(CheckSubClass) { | 165 | 6.66k | static_assert(std::is_base_of_v<RefCounted, Derived>, | 166 | 6.66k | "Derived must subclass RefCounted<Derived>"); | 167 | 6.66k | } |
|
168 | | |
169 | 1.16M | ~RefCounted() { BSSL_CHECK(references_.load() == 0); }bssl::RefCounted<bssl::SSLECHKeys>::~RefCounted() Line | Count | Source | 169 | 16.1k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLCredential>::~RefCounted() Line | Count | Source | 169 | 122k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLContext>::~RefCounted() Line | Count | Source | 169 | 5.06k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::SSLSession>::~RefCounted() Line | Count | Source | 169 | 255k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
Unexecuted instantiation: bssl::RefCounted<bssl::DHImpl>::~RefCounted() Unexecuted instantiation: bssl::RefCounted<bssl::ECCustomGroup>::~RefCounted() bssl::RefCounted<bssl::ECKey>::~RefCounted() Line | Count | Source | 169 | 65.6k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::RSAImpl>::~RefCounted() Line | Count | Source | 169 | 125k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::Bio>::~RefCounted() Line | Count | Source | 169 | 77.1k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::EvpPkey>::~RefCounted() Line | Count | Source | 169 | 269k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPoolHandle>::~RefCounted() Unexecuted instantiation: bssl::RefCounted<bssl::CryptoBufferPool>::~RefCounted() bssl::RefCounted<bssl::X509Store>::~RefCounted() Line | Count | Source | 169 | 5.06k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::X509Impl>::~RefCounted() Line | Count | Source | 169 | 215k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
bssl::RefCounted<bssl::DSAImpl>::~RefCounted() Line | Count | Source | 169 | 6.66k | ~RefCounted() { BSSL_CHECK(references_.load() == 0); } |
|
170 | | |
171 | | private: |
172 | | mutable CRYPTO_refcount_t references_ = 1; |
173 | | }; |
174 | | |
175 | | |
176 | | // Containers. |
177 | | |
178 | | // Array<T> is an owning array of elements of `T`. |
179 | | template <typename T> |
180 | | class Array { |
181 | | public: |
182 | | using value_type = std::remove_cv_t<T>; |
183 | | |
184 | | // Array's default constructor creates an empty array. |
185 | 8.41M | Array() {}bssl::Array<unsigned char>::Array() Line | Count | Source | 185 | 7.05M | Array() {} |
bssl::Array<unsigned short>::Array() Line | Count | Source | 185 | 778k | Array() {} |
bssl::Array<bool>::Array() Line | Count | Source | 185 | 170k | Array() {} |
Unexecuted instantiation: bssl::Array<unsigned long>::Array() bssl::Array<unsigned int>::Array() Line | Count | Source | 185 | 63.9k | Array() {} |
bssl::Array<bssl::SSLCredential*>::Array() Line | Count | Source | 185 | 21.2k | Array() {} |
bssl::Array<int>::Array() Line | Count | Source | 185 | 5.64k | Array() {} |
bssl::Array<crypto_iovec_st>::Array() Line | Count | Source | 185 | 4.41k | Array() {} |
bssl::Array<cbs_st>::Array() Line | Count | Source | 185 | 314k | Array() {} |
|
186 | | Array(const Array &) = delete; |
187 | 555k | Array(Array &&other) { *this = std::move(other); }bssl::Array<unsigned char>::Array(bssl::Array<unsigned char>&&) Line | Count | Source | 187 | 470k | Array(Array &&other) { *this = std::move(other); } |
bssl::Array<bool>::Array(bssl::Array<bool>&&) Line | Count | Source | 187 | 85.2k | Array(Array &&other) { *this = std::move(other); } |
|
188 | | |
189 | 8.97M | ~Array() { Reset(); }bssl::Array<unsigned char>::~Array() Line | Count | Source | 189 | 7.52M | ~Array() { Reset(); } |
bssl::Array<unsigned short>::~Array() Line | Count | Source | 189 | 778k | ~Array() { Reset(); } |
bssl::Array<bool>::~Array() Line | Count | Source | 189 | 255k | ~Array() { Reset(); } |
bssl::Array<unsigned int>::~Array() Line | Count | Source | 189 | 63.9k | ~Array() { Reset(); } |
Unexecuted instantiation: bssl::Array<unsigned long>::~Array() bssl::Array<bssl::SSLCredential*>::~Array() Line | Count | Source | 189 | 21.2k | ~Array() { Reset(); } |
bssl::Array<int>::~Array() Line | Count | Source | 189 | 5.64k | ~Array() { Reset(); } |
bssl::Array<crypto_iovec_st>::~Array() Line | Count | Source | 189 | 4.41k | ~Array() { Reset(); } |
bssl::Array<cbs_st>::~Array() Line | Count | Source | 189 | 314k | ~Array() { Reset(); } |
|
190 | | |
191 | | Array &operator=(const Array &) = delete; |
192 | 751k | Array &operator=(Array &&other) { |
193 | 751k | Reset(); |
194 | 751k | other.Release(&data_, &size_); |
195 | 751k | return *this; |
196 | 751k | } bssl::Array<unsigned char>::operator=(bssl::Array<unsigned char>&&) Line | Count | Source | 192 | 549k | Array &operator=(Array &&other) { | 193 | 549k | Reset(); | 194 | 549k | other.Release(&data_, &size_); | 195 | 549k | return *this; | 196 | 549k | } |
bssl::Array<unsigned short>::operator=(bssl::Array<unsigned short>&&) Line | Count | Source | 192 | 31.6k | Array &operator=(Array &&other) { | 193 | 31.6k | Reset(); | 194 | 31.6k | other.Release(&data_, &size_); | 195 | 31.6k | return *this; | 196 | 31.6k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::operator=(bssl::Array<unsigned int>&&) bssl::Array<bool>::operator=(bssl::Array<bool>&&) Line | Count | Source | 192 | 170k | Array &operator=(Array &&other) { | 193 | 170k | Reset(); | 194 | 170k | other.Release(&data_, &size_); | 195 | 170k | return *this; | 196 | 170k | } |
|
197 | | |
198 | 4.07M | const T *data() const { return data_; }bssl::Array<unsigned char>::data() const Line | Count | Source | 198 | 3.34M | const T *data() const { return data_; } |
bssl::Array<bool>::data() const Line | Count | Source | 198 | 122k | const T *data() const { return data_; } |
bssl::Array<unsigned short>::data() const Line | Count | Source | 198 | 474k | const T *data() const { return data_; } |
bssl::Array<unsigned int>::data() const Line | Count | Source | 198 | 130k | const T *data() const { return data_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::data() const |
199 | 362k | T *data() { return data_; }bssl::Array<unsigned char>::data() Line | Count | Source | 199 | 358k | T *data() { return data_; } |
bssl::Array<unsigned short>::data() Line | Count | Source | 199 | 4.69k | T *data() { return data_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::data() |
200 | 9.62M | size_t size() const { return size_; }bssl::Array<unsigned char>::size() const Line | Count | Source | 200 | 7.69M | size_t size() const { return size_; } |
bssl::Array<bool>::size() const Line | Count | Source | 200 | 208k | size_t size() const { return size_; } |
bssl::Array<unsigned short>::size() const Line | Count | Source | 200 | 1.60M | size_t size() const { return size_; } |
bssl::Array<unsigned int>::size() const Line | Count | Source | 200 | 130k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::size() const |
201 | 3.16M | bool empty() const { return size_ == 0; }bssl::Array<unsigned char>::empty() const Line | Count | Source | 201 | 2.86M | bool empty() const { return size_ == 0; } |
bssl::Array<unsigned short>::empty() const Line | Count | Source | 201 | 176k | bool empty() const { return size_ == 0; } |
bssl::Array<bssl::SSLCredential*>::empty() const Line | Count | Source | 201 | 12.4k | bool empty() const { return size_ == 0; } |
bssl::Array<bool>::empty() const Line | Count | Source | 201 | 85.2k | bool empty() const { return size_ == 0; } |
bssl::Array<crypto_iovec_st>::empty() const Line | Count | Source | 201 | 17.6k | bool empty() const { return size_ == 0; } |
|
202 | | |
203 | 2.18M | const T &operator[](size_t i) const { |
204 | 2.18M | BSSL_CHECK(i < size_); |
205 | 2.18M | return data_[i]; |
206 | 2.18M | } bssl::Array<bool>::operator[](unsigned long) const Line | Count | Source | 203 | 168k | const T &operator[](size_t i) const { | 204 | 168k | BSSL_CHECK(i < size_); | 205 | 168k | return data_[i]; | 206 | 168k | } |
bssl::Array<unsigned char>::operator[](unsigned long) const Line | Count | Source | 203 | 2.01M | const T &operator[](size_t i) const { | 204 | 2.01M | BSSL_CHECK(i < size_); | 205 | 2.01M | return data_[i]; | 206 | 2.01M | } |
|
207 | 11.1M | T &operator[](size_t i) { |
208 | 11.1M | BSSL_CHECK(i < size_); |
209 | 11.1M | return data_[i]; |
210 | 11.1M | } bssl::Array<unsigned short>::operator[](unsigned long) Line | Count | Source | 207 | 2.20M | T &operator[](size_t i) { | 208 | 2.20M | BSSL_CHECK(i < size_); | 209 | 2.20M | return data_[i]; | 210 | 2.20M | } |
bssl::Array<unsigned char>::operator[](unsigned long) Line | Count | Source | 207 | 1.83M | T &operator[](size_t i) { | 208 | 1.83M | BSSL_CHECK(i < size_); | 209 | 1.83M | return data_[i]; | 210 | 1.83M | } |
Unexecuted instantiation: bssl::Array<unsigned long>::operator[](unsigned long) Unexecuted instantiation: bssl::Array<unsigned int>::operator[](unsigned long) bssl::Array<int>::operator[](unsigned long) Line | Count | Source | 207 | 907k | T &operator[](size_t i) { | 208 | 907k | BSSL_CHECK(i < size_); | 209 | 907k | return data_[i]; | 210 | 907k | } |
bssl::Array<bool>::operator[](unsigned long) Line | Count | Source | 207 | 157k | T &operator[](size_t i) { | 208 | 157k | BSSL_CHECK(i < size_); | 209 | 157k | return data_[i]; | 210 | 157k | } |
bssl::Array<bssl::SSLCredential*>::operator[](unsigned long) Line | Count | Source | 207 | 21.2k | T &operator[](size_t i) { | 208 | 21.2k | BSSL_CHECK(i < size_); | 209 | 21.2k | return data_[i]; | 210 | 21.2k | } |
bssl::Array<cbs_st>::operator[](unsigned long) Line | Count | Source | 207 | 6.06M | T &operator[](size_t i) { | 208 | 6.06M | BSSL_CHECK(i < size_); | 209 | 6.06M | return data_[i]; | 210 | 6.06M | } |
|
211 | | |
212 | | T &front() { |
213 | | BSSL_CHECK(size_ != 0); |
214 | | return data_[0]; |
215 | | } |
216 | | const T &front() const { |
217 | | BSSL_CHECK(size_ != 0); |
218 | | return data_[0]; |
219 | | } |
220 | 73.9k | T &back() { |
221 | 73.9k | BSSL_CHECK(size_ != 0); |
222 | 73.9k | return data_[size_ - 1]; |
223 | 73.9k | } |
224 | | const T &back() const { |
225 | | BSSL_CHECK(size_ != 0); |
226 | | return data_[size_ - 1]; |
227 | | } |
228 | | |
229 | 568k | T *begin() { return data_; }bssl::Array<unsigned short>::begin() Line | Count | Source | 229 | 224k | T *begin() { return data_; } |
bssl::Array<bssl::SSLCredential*>::begin() Line | Count | Source | 229 | 21.1k | T *begin() { return data_; } |
bssl::Array<unsigned char>::begin() Line | Count | Source | 229 | 8.73k | T *begin() { return data_; } |
bssl::Array<cbs_st>::begin() Line | Count | Source | 229 | 314k | T *begin() { return data_; } |
|
230 | 0 | const T *begin() const { return data_; } |
231 | 577k | T *end() { return data_ + size_; }bssl::Array<unsigned short>::end() Line | Count | Source | 231 | 224k | T *end() { return data_ + size_; } |
bssl::Array<bssl::SSLCredential*>::end() Line | Count | Source | 231 | 21.1k | T *end() { return data_ + size_; } |
bssl::Array<unsigned char>::end() Line | Count | Source | 231 | 17.4k | T *end() { return data_ + size_; } |
bssl::Array<cbs_st>::end() Line | Count | Source | 231 | 314k | T *end() { return data_ + size_; } |
|
232 | 0 | const T *end() const { return data_ + size_; } |
233 | | |
234 | 12.7M | void Reset() { Reset(nullptr, 0); }bssl::Array<unsigned char>::Reset() Line | Count | Source | 234 | 10.2M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<unsigned short>::Reset() Line | Count | Source | 234 | 1.18M | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bool>::Reset() Line | Count | Source | 234 | 516k | void Reset() { Reset(nullptr, 0); } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset() bssl::Array<unsigned int>::Reset() Line | Count | Source | 234 | 136k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<bssl::SSLCredential*>::Reset() Line | Count | Source | 234 | 42.4k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<int>::Reset() Line | Count | Source | 234 | 11.2k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<crypto_iovec_st>::Reset() Line | Count | Source | 234 | 8.83k | void Reset() { Reset(nullptr, 0); } |
bssl::Array<cbs_st>::Reset() Line | Count | Source | 234 | 628k | void Reset() { Reset(nullptr, 0); } |
|
235 | | |
236 | | // Reset releases the current contents of the array and takes ownership of the |
237 | | // raw pointer supplied by the caller. |
238 | 13.8M | void Reset(T *new_data, size_t new_size) { |
239 | 13.8M | std::destroy_n(data_, size_); |
240 | 13.8M | OPENSSL_free(data_); |
241 | 13.8M | data_ = new_data; |
242 | 13.8M | size_ = new_size; |
243 | 13.8M | } bssl::Array<unsigned char>::Reset(unsigned char*, unsigned long) Line | Count | Source | 238 | 11.3M | void Reset(T *new_data, size_t new_size) { | 239 | 11.3M | std::destroy_n(data_, size_); | 240 | 11.3M | OPENSSL_free(data_); | 241 | 11.3M | data_ = new_data; | 242 | 11.3M | size_ = new_size; | 243 | 11.3M | } |
bssl::Array<unsigned short>::Reset(unsigned short*, unsigned long) Line | Count | Source | 238 | 1.18M | void Reset(T *new_data, size_t new_size) { | 239 | 1.18M | std::destroy_n(data_, size_); | 240 | 1.18M | OPENSSL_free(data_); | 241 | 1.18M | data_ = new_data; | 242 | 1.18M | size_ = new_size; | 243 | 1.18M | } |
bssl::Array<bool>::Reset(bool*, unsigned long) Line | Count | Source | 238 | 516k | void Reset(T *new_data, size_t new_size) { | 239 | 516k | std::destroy_n(data_, size_); | 240 | 516k | OPENSSL_free(data_); | 241 | 516k | data_ = new_data; | 242 | 516k | size_ = new_size; | 243 | 516k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::Reset(unsigned long*, unsigned long) bssl::Array<unsigned int>::Reset(unsigned int*, unsigned long) Line | Count | Source | 238 | 136k | void Reset(T *new_data, size_t new_size) { | 239 | 136k | std::destroy_n(data_, size_); | 240 | 136k | OPENSSL_free(data_); | 241 | 136k | data_ = new_data; | 242 | 136k | size_ = new_size; | 243 | 136k | } |
bssl::Array<bssl::SSLCredential*>::Reset(bssl::SSLCredential**, unsigned long) Line | Count | Source | 238 | 42.4k | void Reset(T *new_data, size_t new_size) { | 239 | 42.4k | std::destroy_n(data_, size_); | 240 | 42.4k | OPENSSL_free(data_); | 241 | 42.4k | data_ = new_data; | 242 | 42.4k | size_ = new_size; | 243 | 42.4k | } |
bssl::Array<int>::Reset(int*, unsigned long) Line | Count | Source | 238 | 11.2k | void Reset(T *new_data, size_t new_size) { | 239 | 11.2k | std::destroy_n(data_, size_); | 240 | 11.2k | OPENSSL_free(data_); | 241 | 11.2k | data_ = new_data; | 242 | 11.2k | size_ = new_size; | 243 | 11.2k | } |
bssl::Array<crypto_iovec_st>::Reset(crypto_iovec_st*, unsigned long) Line | Count | Source | 238 | 8.83k | void Reset(T *new_data, size_t new_size) { | 239 | 8.83k | std::destroy_n(data_, size_); | 240 | 8.83k | OPENSSL_free(data_); | 241 | 8.83k | data_ = new_data; | 242 | 8.83k | size_ = new_size; | 243 | 8.83k | } |
bssl::Array<cbs_st>::Reset(cbs_st*, unsigned long) Line | Count | Source | 238 | 628k | void Reset(T *new_data, size_t new_size) { | 239 | 628k | std::destroy_n(data_, size_); | 240 | 628k | OPENSSL_free(data_); | 241 | 628k | data_ = new_data; | 242 | 628k | size_ = new_size; | 243 | 628k | } |
|
244 | | |
245 | | // Release releases ownership of the array to a raw pointer supplied by the |
246 | | // caller. |
247 | 751k | void Release(T **out, size_t *out_size) { |
248 | 751k | *out = data_; |
249 | 751k | *out_size = size_; |
250 | 751k | data_ = nullptr; |
251 | 751k | size_ = 0; |
252 | 751k | } bssl::Array<unsigned char>::Release(unsigned char**, unsigned long*) Line | Count | Source | 247 | 549k | void Release(T **out, size_t *out_size) { | 248 | 549k | *out = data_; | 249 | 549k | *out_size = size_; | 250 | 549k | data_ = nullptr; | 251 | 549k | size_ = 0; | 252 | 549k | } |
bssl::Array<unsigned short>::Release(unsigned short**, unsigned long*) Line | Count | Source | 247 | 31.6k | void Release(T **out, size_t *out_size) { | 248 | 31.6k | *out = data_; | 249 | 31.6k | *out_size = size_; | 250 | 31.6k | data_ = nullptr; | 251 | 31.6k | size_ = 0; | 252 | 31.6k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Release(unsigned int**, unsigned long*) bssl::Array<bool>::Release(bool**, unsigned long*) Line | Count | Source | 247 | 170k | void Release(T **out, size_t *out_size) { | 248 | 170k | *out = data_; | 249 | 170k | *out_size = size_; | 250 | 170k | data_ = nullptr; | 251 | 170k | size_ = 0; | 252 | 170k | } |
|
253 | | |
254 | | // Init replaces the array with a newly-allocated array of `new_size` |
255 | | // value-constructed copies of `T`. It returns true on success and false on |
256 | | // error. If `T` is a primitive type like `uint8_t`, value-construction means |
257 | | // it will be zero-initialized. |
258 | 415k | [[nodiscard]] bool Init(size_t new_size) { |
259 | 415k | if (!InitUninitialized(new_size)) { |
260 | 0 | return false; |
261 | 0 | } |
262 | 415k | std::uninitialized_value_construct_n(data_, size_); |
263 | 415k | return true; |
264 | 415k | } Unexecuted instantiation: bssl::Array<unsigned long>::Init(unsigned long) bssl::Array<unsigned int>::Init(unsigned long) Line | Count | Source | 258 | 13.1k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 13.1k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 13.1k | std::uninitialized_value_construct_n(data_, size_); | 263 | 13.1k | return true; | 264 | 13.1k | } |
bssl::Array<unsigned char>::Init(unsigned long) Line | Count | Source | 258 | 81.9k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 81.9k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 81.9k | std::uninitialized_value_construct_n(data_, size_); | 263 | 81.9k | return true; | 264 | 81.9k | } |
bssl::Array<int>::Init(unsigned long) Line | Count | Source | 258 | 5.64k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 5.64k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 5.64k | std::uninitialized_value_construct_n(data_, size_); | 263 | 5.64k | return true; | 264 | 5.64k | } |
Unexecuted instantiation: bssl::Array<bool>::Init(unsigned long) bssl::Array<cbs_st>::Init(unsigned long) Line | Count | Source | 258 | 314k | [[nodiscard]] bool Init(size_t new_size) { | 259 | 314k | if (!InitUninitialized(new_size)) { | 260 | 0 | return false; | 261 | 0 | } | 262 | 314k | std::uninitialized_value_construct_n(data_, size_); | 263 | 314k | return true; | 264 | 314k | } |
|
265 | | |
266 | | // InitForOverwrite behaves like `Init` but it default-constructs each element |
267 | | // instead. This means that, if `T` is a primitive type, the array will be |
268 | | // uninitialized and thus must be filled in by the caller. |
269 | 367k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { |
270 | 367k | if (!InitUninitialized(new_size)) { |
271 | 0 | return false; |
272 | 0 | } |
273 | 367k | std::uninitialized_default_construct_n(data_, size_); |
274 | 367k | return true; |
275 | 367k | } bssl::Array<unsigned char>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 158k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 158k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 158k | std::uninitialized_default_construct_n(data_, size_); | 274 | 158k | return true; | 275 | 158k | } |
bssl::Array<unsigned short>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 166k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 166k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 166k | std::uninitialized_default_construct_n(data_, size_); | 274 | 166k | return true; | 275 | 166k | } |
bssl::Array<bool>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 21.2k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 21.2k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 21.2k | std::uninitialized_default_construct_n(data_, size_); | 274 | 21.2k | return true; | 275 | 21.2k | } |
bssl::Array<bssl::SSLCredential*>::InitForOverwrite(unsigned long) Line | Count | Source | 269 | 21.2k | [[nodiscard]] bool InitForOverwrite(size_t new_size) { | 270 | 21.2k | if (!InitUninitialized(new_size)) { | 271 | 0 | return false; | 272 | 0 | } | 273 | 21.2k | std::uninitialized_default_construct_n(data_, size_); | 274 | 21.2k | return true; | 275 | 21.2k | } |
|
276 | | |
277 | | // CopyFrom replaces the array with a newly-allocated copy of `in`. It returns |
278 | | // true on success and false on error. |
279 | | // |
280 | | // `in` may not alias `this`. |
281 | 1.87M | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
282 | 1.87M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
283 | 1.87M | if (!InitUninitialized(in.size())) { |
284 | 0 | return false; |
285 | 0 | } |
286 | 1.87M | std::uninitialized_copy(in.begin(), in.end(), data_); |
287 | 1.87M | return true; |
288 | 1.87M | } bssl::Array<unsigned char>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 281 | 1.55M | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 1.55M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 1.55M | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 1.55M | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 1.55M | return true; | 288 | 1.55M | } |
bssl::Array<bool>::CopyFrom(bssl::Span<bool const, 18446744073709551615ul>) Line | Count | Source | 281 | 63.9k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 63.9k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 63.9k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 63.9k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 63.9k | return true; | 288 | 63.9k | } |
bssl::Array<unsigned short>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) Line | Count | Source | 281 | 194k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 194k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 194k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 194k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 194k | return true; | 288 | 194k | } |
bssl::Array<unsigned int>::CopyFrom(bssl::Span<unsigned int const, 18446744073709551615ul>) Line | Count | Source | 281 | 58.8k | [[nodiscard]] bool CopyFrom(Span<const T> in) { | 282 | 58.8k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 283 | 58.8k | if (!InitUninitialized(in.size())) { | 284 | 0 | return false; | 285 | 0 | } | 286 | 58.8k | std::uninitialized_copy(in.begin(), in.end(), data_); | 287 | 58.8k | return true; | 288 | 58.8k | } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::CopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) |
289 | | |
290 | | // Shrink shrinks the stored size of the array to `new_size`. It crashes if |
291 | | // the new size is larger. Note this does not shrink the allocation itself. |
292 | 25.0k | void Shrink(size_t new_size) { |
293 | 25.0k | if (new_size > size_) { |
294 | 0 | abort(); |
295 | 0 | } |
296 | 25.0k | std::destroy_n(data_ + new_size, size_ - new_size); |
297 | 25.0k | size_ = new_size; |
298 | 25.0k | } Unexecuted instantiation: bssl::Array<unsigned char>::Shrink(unsigned long) bssl::Array<unsigned short>::Shrink(unsigned long) Line | Count | Source | 292 | 3.79k | void Shrink(size_t new_size) { | 293 | 3.79k | if (new_size > size_) { | 294 | 0 | abort(); | 295 | 0 | } | 296 | 3.79k | std::destroy_n(data_ + new_size, size_ - new_size); | 297 | 3.79k | size_ = new_size; | 298 | 3.79k | } |
Unexecuted instantiation: bssl::Array<unsigned int>::Shrink(unsigned long) bssl::Array<bool>::Shrink(unsigned long) Line | Count | Source | 292 | 21.2k | void Shrink(size_t new_size) { | 293 | 21.2k | if (new_size > size_) { | 294 | 0 | abort(); | 295 | 0 | } | 296 | 21.2k | std::destroy_n(data_ + new_size, size_ - new_size); | 297 | 21.2k | size_ = new_size; | 298 | 21.2k | } |
|
299 | | |
300 | | private: |
301 | | // InitUninitialized replaces the array with a newly-allocated array of |
302 | | // `new_size` elements, but whose constructor has not yet run. On success, the |
303 | | // elements must be constructed before returning control to the caller. |
304 | 2.65M | bool InitUninitialized(size_t new_size) { |
305 | 2.65M | Reset(); |
306 | 2.65M | if (new_size == 0) { |
307 | 1.05M | return true; |
308 | 1.05M | } |
309 | | |
310 | 1.59M | if (new_size > SIZE_MAX / sizeof(T)) { |
311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
312 | 0 | return false; |
313 | 0 | } |
314 | 1.59M | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); |
315 | 1.59M | if (data_ == nullptr) { |
316 | 0 | return false; |
317 | 0 | } |
318 | 1.59M | size_ = new_size; |
319 | 1.59M | return true; |
320 | 1.59M | } bssl::Array<unsigned char>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 1.79M | bool InitUninitialized(size_t new_size) { | 305 | 1.79M | Reset(); | 306 | 1.79M | if (new_size == 0) { | 307 | 938k | return true; | 308 | 938k | } | 309 | | | 310 | 856k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 856k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 856k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 856k | size_ = new_size; | 319 | 856k | return true; | 320 | 856k | } |
bssl::Array<unsigned short>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 360k | bool InitUninitialized(size_t new_size) { | 305 | 360k | Reset(); | 306 | 360k | if (new_size == 0) { | 307 | 119k | return true; | 308 | 119k | } | 309 | | | 310 | 241k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 241k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 241k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 241k | size_ = new_size; | 319 | 241k | return true; | 320 | 241k | } |
Unexecuted instantiation: bssl::Array<unsigned long>::InitUninitialized(unsigned long) bssl::Array<unsigned int>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 72.0k | bool InitUninitialized(size_t new_size) { | 305 | 72.0k | Reset(); | 306 | 72.0k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 72.0k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 72.0k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 72.0k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 72.0k | size_ = new_size; | 319 | 72.0k | return true; | 320 | 72.0k | } |
bssl::Array<int>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 5.64k | bool InitUninitialized(size_t new_size) { | 305 | 5.64k | Reset(); | 306 | 5.64k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 5.64k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 5.64k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 5.64k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 5.64k | size_ = new_size; | 319 | 5.64k | return true; | 320 | 5.64k | } |
bssl::Array<bool>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 85.2k | bool InitUninitialized(size_t new_size) { | 305 | 85.2k | Reset(); | 306 | 85.2k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 85.2k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 85.2k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 85.2k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 85.2k | size_ = new_size; | 319 | 85.2k | return true; | 320 | 85.2k | } |
bssl::Array<bssl::SSLCredential*>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 21.2k | bool InitUninitialized(size_t new_size) { | 305 | 21.2k | Reset(); | 306 | 21.2k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 21.2k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 21.2k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 21.2k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 21.2k | size_ = new_size; | 319 | 21.2k | return true; | 320 | 21.2k | } |
Unexecuted instantiation: bssl::Array<crypto_iovec_st>::InitUninitialized(unsigned long) bssl::Array<cbs_st>::InitUninitialized(unsigned long) Line | Count | Source | 304 | 314k | bool InitUninitialized(size_t new_size) { | 305 | 314k | Reset(); | 306 | 314k | if (new_size == 0) { | 307 | 0 | return true; | 308 | 0 | } | 309 | | | 310 | 314k | if (new_size > SIZE_MAX / sizeof(T)) { | 311 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 312 | 0 | return false; | 313 | 0 | } | 314 | 314k | data_ = reinterpret_cast<T *>(OPENSSL_malloc(new_size * sizeof(T))); | 315 | 314k | if (data_ == nullptr) { | 316 | 0 | return false; | 317 | 0 | } | 318 | 314k | size_ = new_size; | 319 | 314k | return true; | 320 | 314k | } |
|
321 | | |
322 | | T *data_ = nullptr; |
323 | | size_t size_ = 0; |
324 | | }; |
325 | | |
326 | | // Vector<T> is a resizable array of elements of `T`. |
327 | | template <typename T> |
328 | | class Vector { |
329 | | public: |
330 | 560k | Vector() = default; bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 16.1k | Vector() = default; |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::Vector() Line | Count | Source | 330 | 98.4k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 63.9k | Vector() = default; |
bssl::Vector<bssl::Array<unsigned char> >::Vector() Line | Count | Source | 330 | 122k | Vector() = default; |
bssl::Vector<bssl::CertCompressionAlg>::Vector() Line | Count | Source | 330 | 5.07k | Vector() = default; |
bssl::Vector<bssl::ALPSConfig>::Vector() Line | Count | Source | 330 | 58.8k | Vector() = default; |
bssl::Vector<unsigned char>::Vector() Line | Count | Source | 330 | 51.6k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 68.9k | Vector() = default; |
bssl::Vector<unsigned long>::Vector() Line | Count | Source | 330 | 68.9k | Vector() = default; |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::Vector() Line | Count | Source | 330 | 5.07k | Vector() = default; |
Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Vector() |
331 | | Vector(const Vector &) = delete; |
332 | 51.6k | Vector(Vector &&other) { *this = std::move(other); }bssl::Vector<unsigned char>::Vector(bssl::Vector<unsigned char>&&) Line | Count | Source | 332 | 51.6k | Vector(Vector &&other) { *this = std::move(other); } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Vector(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Vector(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
333 | 611k | ~Vector() { clear(); }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 16.1k | ~Vector() { clear(); } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::~Vector() Line | Count | Source | 333 | 98.4k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 63.9k | ~Vector() { clear(); } |
bssl::Vector<bssl::Array<unsigned char> >::~Vector() Line | Count | Source | 333 | 122k | ~Vector() { clear(); } |
bssl::Vector<bssl::CertCompressionAlg>::~Vector() Line | Count | Source | 333 | 5.06k | ~Vector() { clear(); } |
bssl::Vector<bssl::ALPSConfig>::~Vector() Line | Count | Source | 333 | 58.8k | ~Vector() { clear(); } |
bssl::Vector<unsigned char>::~Vector() Line | Count | Source | 333 | 103k | ~Vector() { clear(); } |
bssl::Vector<unsigned long>::~Vector() Line | Count | Source | 333 | 68.9k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 68.9k | ~Vector() { clear(); } |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::~Vector() Line | Count | Source | 333 | 5.06k | ~Vector() { clear(); } |
Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::~Vector() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::~Vector() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::~Vector() |
334 | | |
335 | | Vector &operator=(const Vector &) = delete; |
336 | 51.6k | Vector &operator=(Vector &&other) { |
337 | 51.6k | clear(); |
338 | 51.6k | std::swap(data_, other.data_); |
339 | 51.6k | std::swap(size_, other.size_); |
340 | 51.6k | std::swap(capacity_, other.capacity_); |
341 | 51.6k | return *this; |
342 | 51.6k | } bssl::Vector<unsigned char>::operator=(bssl::Vector<unsigned char>&&) Line | Count | Source | 336 | 51.6k | Vector &operator=(Vector &&other) { | 337 | 51.6k | clear(); | 338 | 51.6k | std::swap(data_, other.data_); | 339 | 51.6k | std::swap(size_, other.size_); | 340 | 51.6k | std::swap(capacity_, other.capacity_); | 341 | 51.6k | return *this; | 342 | 51.6k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::operator=(bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >&&) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator=(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&&) |
343 | | |
344 | 50.9k | const T *data() const { return data_; }bssl::Vector<unsigned char>::data() const Line | Count | Source | 344 | 50.9k | const T *data() const { return data_; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() const |
345 | 0 | T *data() { return data_; }Unexecuted instantiation: bssl::Vector<unsigned char>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::data() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::data() |
346 | 31.2M | size_t size() const { return size_; }bssl::Vector<bssl::CertCompressionAlg>::size() const Line | Count | Source | 346 | 66 | size_t size() const { return size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::size() const Line | Count | Source | 346 | 48 | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::size() const Line | Count | Source | 346 | 42.4k | size_t size() const { return size_; } |
bssl::Vector<unsigned char>::size() const Line | Count | Source | 346 | 116k | size_t size() const { return size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::size() const Line | Count | Source | 346 | 31.1M | size_t size() const { return size_; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::size() const Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::size() const |
347 | 18.7M | bool empty() const { return size_ == 0; }bssl::Vector<bssl::ALPSConfig>::empty() const Line | Count | Source | 347 | 109k | bool empty() const { return size_ == 0; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::empty() const Line | Count | Source | 347 | 111k | bool empty() const { return size_ == 0; } |
bssl::Vector<unsigned long>::empty() const Line | Count | Source | 347 | 18.4M | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::empty() const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::empty() const |
348 | | |
349 | 0 | const T &operator[](size_t i) const { |
350 | 0 | BSSL_CHECK(i < size_); |
351 | 0 | return data_[i]; |
352 | 0 | } Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::operator[](unsigned long) const Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) const |
353 | 31.1M | T &operator[](size_t i) { |
354 | 31.1M | BSSL_CHECK(i < size_); |
355 | 31.1M | return data_[i]; |
356 | 31.1M | } bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::operator[](unsigned long) Line | Count | Source | 353 | 45 | T &operator[](size_t i) { | 354 | 45 | BSSL_CHECK(i < size_); | 355 | 45 | return data_[i]; | 356 | 45 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::operator[](unsigned long) bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::operator[](unsigned long) Line | Count | Source | 353 | 31.1M | T &operator[](size_t i) { | 354 | 31.1M | BSSL_CHECK(i < size_); | 355 | 31.1M | return data_[i]; | 356 | 31.1M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::operator[](unsigned long) |
357 | | |
358 | | T &front() { |
359 | | BSSL_CHECK(size_ != 0); |
360 | | return data_[0]; |
361 | | } |
362 | | const T &front() const { |
363 | | BSSL_CHECK(size_ != 0); |
364 | | return data_[0]; |
365 | | } |
366 | 18.4M | T &back() { |
367 | 18.4M | BSSL_CHECK(size_ != 0); |
368 | 18.4M | return data_[size_ - 1]; |
369 | 18.4M | } bssl::Vector<unsigned long>::back() Line | Count | Source | 366 | 18.4M | T &back() { | 367 | 18.4M | BSSL_CHECK(size_ != 0); | 368 | 18.4M | return data_[size_ - 1]; | 369 | 18.4M | } |
Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::back() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::back() |
370 | | const T &back() const { |
371 | | BSSL_CHECK(size_ != 0); |
372 | | return data_[size_ - 1]; |
373 | | } |
374 | | |
375 | 420k | T *begin() { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 420 | T *begin() { return data_; } |
bssl::Vector<bssl::CertCompressionAlg>::begin() Line | Count | Source | 375 | 54.6k | T *begin() { return data_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::begin() Line | Count | Source | 375 | 1.57k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 270k | T *begin() { return data_; } |
bssl::Vector<bssl::ALPSConfig>::begin() Line | Count | Source | 375 | 94 | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::begin() bssl::Vector<unsigned char>::begin() Line | Count | Source | 375 | 3.69k | T *begin() { return data_; } |
bssl::Vector<unsigned long>::begin() Line | Count | Source | 375 | 43.0k | T *begin() { return data_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::begin() Line | Count | Source | 375 | 45.7k | T *begin() { return data_; } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::begin() Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::begin() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::begin() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::begin() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::begin() |
376 | 54.0k | const T *begin() const { return data_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::begin() const Line | Count | Source | 376 | 6 | const T *begin() const { return data_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::begin() const Line | Count | Source | 376 | 1.22k | const T *begin() const { return data_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::begin() const Line | Count | Source | 376 | 52.8k | const T *begin() const { return data_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::begin() const Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::begin() const |
377 | 420k | T *end() { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 420 | T *end() { return data_ + size_; } |
bssl::Vector<bssl::CertCompressionAlg>::end() Line | Count | Source | 377 | 54.6k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::end() Line | Count | Source | 377 | 1.57k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 270k | T *end() { return data_ + size_; } |
bssl::Vector<bssl::ALPSConfig>::end() Line | Count | Source | 377 | 94 | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::end() bssl::Vector<unsigned char>::end() Line | Count | Source | 377 | 3.69k | T *end() { return data_ + size_; } |
bssl::Vector<unsigned long>::end() Line | Count | Source | 377 | 43.0k | T *end() { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::end() Line | Count | Source | 377 | 45.7k | T *end() { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::end() Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::end() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::end() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::end() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::end() |
378 | 54.0k | const T *end() const { return data_ + size_; }bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::end() const Line | Count | Source | 378 | 6 | const T *end() const { return data_ + size_; } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::end() const Line | Count | Source | 378 | 1.22k | const T *end() const { return data_ + size_; } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::end() const Line | Count | Source | 378 | 52.8k | const T *end() const { return data_ + size_; } |
Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::end() const Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::end() const |
379 | | |
380 | 803k | void clear() { |
381 | 803k | std::destroy_n(data_, size_); |
382 | 803k | OPENSSL_free(data_); |
383 | 803k | data_ = nullptr; |
384 | 803k | size_ = 0; |
385 | 803k | capacity_ = 0; |
386 | 803k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 16.1k | void clear() { | 381 | 16.1k | std::destroy_n(data_, size_); | 382 | 16.1k | OPENSSL_free(data_); | 383 | 16.1k | data_ = nullptr; | 384 | 16.1k | size_ = 0; | 385 | 16.1k | capacity_ = 0; | 386 | 16.1k | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::clear() Line | Count | Source | 380 | 146k | void clear() { | 381 | 146k | std::destroy_n(data_, size_); | 382 | 146k | OPENSSL_free(data_); | 383 | 146k | data_ = nullptr; | 384 | 146k | size_ = 0; | 385 | 146k | capacity_ = 0; | 386 | 146k | } |
bssl::Vector<bssl::ALPSConfig>::clear() Line | Count | Source | 380 | 58.8k | void clear() { | 381 | 58.8k | std::destroy_n(data_, size_); | 382 | 58.8k | OPENSSL_free(data_); | 383 | 58.8k | data_ = nullptr; | 384 | 58.8k | size_ = 0; | 385 | 58.8k | capacity_ = 0; | 386 | 58.8k | } |
bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 63.9k | void clear() { | 381 | 63.9k | std::destroy_n(data_, size_); | 382 | 63.9k | OPENSSL_free(data_); | 383 | 63.9k | data_ = nullptr; | 384 | 63.9k | size_ = 0; | 385 | 63.9k | capacity_ = 0; | 386 | 63.9k | } |
bssl::Vector<bssl::Array<unsigned char> >::clear() Line | Count | Source | 380 | 122k | void clear() { | 381 | 122k | std::destroy_n(data_, size_); | 382 | 122k | OPENSSL_free(data_); | 383 | 122k | data_ = nullptr; | 384 | 122k | size_ = 0; | 385 | 122k | capacity_ = 0; | 386 | 122k | } |
bssl::Vector<bssl::CertCompressionAlg>::clear() Line | Count | Source | 380 | 5.06k | void clear() { | 381 | 5.06k | std::destroy_n(data_, size_); | 382 | 5.06k | OPENSSL_free(data_); | 383 | 5.06k | data_ = nullptr; | 384 | 5.06k | size_ = 0; | 385 | 5.06k | capacity_ = 0; | 386 | 5.06k | } |
bssl::Vector<unsigned char>::clear() Line | Count | Source | 380 | 158k | void clear() { | 381 | 158k | std::destroy_n(data_, size_); | 382 | 158k | OPENSSL_free(data_); | 383 | 158k | data_ = nullptr; | 384 | 158k | size_ = 0; | 385 | 158k | capacity_ = 0; | 386 | 158k | } |
bssl::Vector<unsigned long>::clear() Line | Count | Source | 380 | 112k | void clear() { | 381 | 112k | std::destroy_n(data_, size_); | 382 | 112k | OPENSSL_free(data_); | 383 | 112k | data_ = nullptr; | 384 | 112k | size_ = 0; | 385 | 112k | capacity_ = 0; | 386 | 112k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 114k | void clear() { | 381 | 114k | std::destroy_n(data_, size_); | 382 | 114k | OPENSSL_free(data_); | 383 | 114k | data_ = nullptr; | 384 | 114k | size_ = 0; | 385 | 114k | capacity_ = 0; | 386 | 114k | } |
bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::clear() Line | Count | Source | 380 | 5.06k | void clear() { | 381 | 5.06k | std::destroy_n(data_, size_); | 382 | 5.06k | OPENSSL_free(data_); | 383 | 5.06k | data_ = nullptr; | 384 | 5.06k | size_ = 0; | 385 | 5.06k | capacity_ = 0; | 386 | 5.06k | } |
Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::clear() Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::clear() Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::clear() Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::clear() Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::clear() |
387 | | |
388 | 18.4M | void pop_back() { |
389 | 18.4M | BSSL_CHECK(size_ != 0); |
390 | 18.4M | std::destroy_at(&data_[size_ - 1]); |
391 | 18.4M | size_--; |
392 | 18.4M | } |
393 | | |
394 | | // Push adds `elem` at the end of the internal array, growing if necessary. It |
395 | | // returns false when allocation fails. |
396 | 18.7M | [[nodiscard]] bool Push(T elem) { |
397 | 18.7M | if (!MaybeGrow(1)) { |
398 | 0 | return false; |
399 | 0 | } |
400 | 18.7M | new (&data_[size_]) T(std::move(elem)); |
401 | 18.7M | size_++; |
402 | 18.7M | return true; |
403 | 18.7M | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>) Line | Count | Source | 396 | 6 | [[nodiscard]] bool Push(T elem) { | 397 | 6 | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 6 | new (&data_[size_]) T(std::move(elem)); | 401 | 6 | size_++; | 402 | 6 | return true; | 403 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::Push(std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >) Line | Count | Source | 396 | 368 | [[nodiscard]] bool Push(T elem) { | 397 | 368 | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 368 | new (&data_[size_]) T(std::move(elem)); | 401 | 368 | size_++; | 402 | 368 | return true; | 403 | 368 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>) Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::Push(bssl::Array<unsigned char>) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::Push(bssl::ALPSConfig) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::Push(bssl::CertCompressionAlg) bssl::Vector<unsigned long>::Push(unsigned long) Line | Count | Source | 396 | 18.4M | [[nodiscard]] bool Push(T elem) { | 397 | 18.4M | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 18.4M | new (&data_[size_]) T(std::move(elem)); | 401 | 18.4M | size_++; | 402 | 18.4M | return true; | 403 | 18.4M | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bignum_st, bssl::internal::Deleter>) Line | Count | Source | 396 | 278k | [[nodiscard]] bool Push(T elem) { | 397 | 278k | if (!MaybeGrow(1)) { | 398 | 0 | return false; | 399 | 0 | } | 400 | 278k | new (&data_[size_]) T(std::move(elem)); | 401 | 278k | size_++; | 402 | 278k | return true; | 403 | 278k | } |
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: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter>) Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::Push(bssl::(anonymous namespace)::ByDirEntry::CRLSuffix) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::Push(bssl::(anonymous namespace)::X509PolicyNode) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::Push(std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter>) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::Push(bssl::(anonymous namespace)::X509PolicyLevel) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::Push(v3_ext_method const*) |
404 | | |
405 | | // CopyFrom replaces the contents of the array with a copy of `in`. It returns |
406 | | // true on success and false on allocation error. |
407 | 0 | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
408 | 0 | Array<T> copy; |
409 | 0 | if (!copy.CopyFrom(in)) { |
410 | 0 | return false; |
411 | 0 | } |
412 | | |
413 | 0 | clear(); |
414 | 0 | copy.Release(&data_, &size_); |
415 | 0 | capacity_ = size_; |
416 | 0 | return true; |
417 | 0 | } |
418 | | |
419 | | // Append appends the contents of `in` to the array. It returns true on |
420 | | // success and false on allocation error. |
421 | 44.6k | [[nodiscard]] bool Append(Span<const T> in) { |
422 | 44.6k | if (!MaybeGrow(in.size())) { |
423 | 0 | return false; |
424 | 0 | } |
425 | 44.6k | std::uninitialized_copy(in.begin(), in.end(), data_ + size_); |
426 | 44.6k | size_ += in.size(); |
427 | 44.6k | return true; |
428 | 44.6k | } |
429 | | |
430 | | // AppendMove moves the contents of `in` and appends them to the array. It |
431 | | // returns true on success and false on allocation error. |
432 | 0 | [[nodiscard]] bool AppendMove(Span<T> in) { |
433 | 0 | if (!MaybeGrow(in.size())) { |
434 | 0 | return false; |
435 | 0 | } |
436 | 0 | std::uninitialized_move(in.begin(), in.end(), data_ + size_); |
437 | 0 | size_ += in.size(); |
438 | 0 | return true; |
439 | 0 | } |
440 | | |
441 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
442 | | template <typename Pred> |
443 | 603 | void EraseIf(Pred pred) { |
444 | 603 | auto it = std::remove_if(begin(), end(), pred); |
445 | 603 | std::destroy(it, end()); |
446 | 603 | size_ = it - begin(); |
447 | 603 | } tls13_client.cc:void bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::EraseIf<bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1>(bssl::do_read_hello_retry_request(bssl::SSL_HANDSHAKE*)::$_1) Line | Count | Source | 443 | 603 | void EraseIf(Pred pred) { | 444 | 603 | auto it = std::remove_if(begin(), end(), pred); | 445 | 603 | std::destroy(it, end()); | 446 | 603 | size_ = it - begin(); | 447 | 603 | } |
Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0>(bssl::(anonymous namespace)::process_certificate_policies(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, int)::$_0) Unexecuted instantiation: policy.cc:void bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::EraseIf<bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0>(bssl::(anonymous namespace)::process_policy_mappings(x509_st const*, bssl::(anonymous namespace)::X509PolicyLevel*, bool)::$_0) |
448 | | |
449 | | private: |
450 | | // If there is no room for `num` elements, creates a new backing array with |
451 | | // double the size of the old one and copies elements over. |
452 | 18.8M | [[nodiscard]] bool MaybeGrow(size_t num) { |
453 | 18.8M | constexpr size_t kDefaultSize = 16; |
454 | 18.8M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); |
455 | 18.8M | if (num > kMaxCapacity - size_) { |
456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); |
457 | 0 | return false; |
458 | 0 | } |
459 | 18.8M | size_t new_capacity = size_ + num; |
460 | | // No need to grow if we have room. |
461 | 18.8M | if (capacity_ >= new_capacity) { |
462 | 18.7M | return true; |
463 | 18.7M | } |
464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at |
465 | | // the start. |
466 | 92.9k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); |
467 | | // At least double the old capacity for linear amortized behavior. |
468 | 92.9k | if (capacity_ <= kMaxCapacity / 2) { |
469 | 92.9k | new_capacity = std::max(new_capacity, capacity_ * 2); |
470 | 92.9k | } |
471 | 92.9k | T *new_data = |
472 | 92.9k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); |
473 | 92.9k | if (new_data == nullptr) { |
474 | 0 | return false; |
475 | 0 | } |
476 | 92.9k | size_t new_size = size_; |
477 | 92.9k | std::uninitialized_move(begin(), end(), new_data); |
478 | 92.9k | clear(); |
479 | 92.9k | data_ = new_data; |
480 | 92.9k | size_ = new_size; |
481 | 92.9k | capacity_ = new_capacity; |
482 | 92.9k | return true; |
483 | 92.9k | } bssl::Vector<std::__1::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 6 | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 6 | constexpr size_t kDefaultSize = 16; | 454 | 6 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 6 | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 6 | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 6 | if (capacity_ >= new_capacity) { | 462 | 0 | return true; | 463 | 0 | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 6 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 6 | if (capacity_ <= kMaxCapacity / 2) { | 469 | 6 | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 6 | } | 471 | 6 | T *new_data = | 472 | 6 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 6 | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 6 | size_t new_size = size_; | 477 | 6 | std::uninitialized_move(begin(), end(), new_data); | 478 | 6 | clear(); | 479 | 6 | data_ = new_data; | 480 | 6 | size_ = new_size; | 481 | 6 | capacity_ = new_capacity; | 482 | 6 | return true; | 483 | 6 | } |
bssl::Vector<std::__1::variant<bssl::SSLImportedPSK, std::__1::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> > >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 368 | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 368 | constexpr size_t kDefaultSize = 16; | 454 | 368 | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 368 | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 368 | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 368 | if (capacity_ >= new_capacity) { | 462 | 0 | return true; | 463 | 0 | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 368 | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 368 | if (capacity_ <= kMaxCapacity / 2) { | 469 | 368 | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 368 | } | 471 | 368 | T *new_data = | 472 | 368 | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 368 | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 368 | size_t new_size = size_; | 477 | 368 | std::uninitialized_move(begin(), end(), new_data); | 478 | 368 | clear(); | 479 | 368 | data_ = new_data; | 480 | 368 | size_ = new_size; | 481 | 368 | capacity_ = new_capacity; | 482 | 368 | return true; | 483 | 368 | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::Array<unsigned char> >::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::ALPSConfig>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<bssl::CertCompressionAlg>::MaybeGrow(unsigned long) bssl::Vector<unsigned char>::MaybeGrow(unsigned long) Line | Count | Source | 452 | 44.6k | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 44.6k | constexpr size_t kDefaultSize = 16; | 454 | 44.6k | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 44.6k | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 44.6k | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 44.6k | if (capacity_ >= new_capacity) { | 462 | 40.9k | return true; | 463 | 40.9k | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 3.69k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 3.69k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 3.69k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 3.69k | } | 471 | 3.69k | T *new_data = | 472 | 3.69k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 3.69k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 3.69k | size_t new_size = size_; | 477 | 3.69k | std::uninitialized_move(begin(), end(), new_data); | 478 | 3.69k | clear(); | 479 | 3.69k | data_ = new_data; | 480 | 3.69k | size_ = new_size; | 481 | 3.69k | capacity_ = new_capacity; | 482 | 3.69k | return true; | 483 | 3.69k | } |
bssl::Vector<unsigned long>::MaybeGrow(unsigned long) Line | Count | Source | 452 | 18.4M | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 18.4M | constexpr size_t kDefaultSize = 16; | 454 | 18.4M | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 18.4M | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 18.4M | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 18.4M | if (capacity_ >= new_capacity) { | 462 | 18.4M | return true; | 463 | 18.4M | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 43.0k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 43.0k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 43.0k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 43.0k | } | 471 | 43.0k | T *new_data = | 472 | 43.0k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 43.0k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 43.0k | size_t new_size = size_; | 477 | 43.0k | std::uninitialized_move(begin(), end(), new_data); | 478 | 43.0k | clear(); | 479 | 43.0k | data_ = new_data; | 480 | 43.0k | size_ = new_size; | 481 | 43.0k | capacity_ = new_capacity; | 482 | 43.0k | return true; | 483 | 43.0k | } |
bssl::Vector<std::__1::unique_ptr<bignum_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Line | Count | Source | 452 | 278k | [[nodiscard]] bool MaybeGrow(size_t num) { | 453 | 278k | constexpr size_t kDefaultSize = 16; | 454 | 278k | constexpr size_t kMaxCapacity = SIZE_MAX / sizeof(T); | 455 | 278k | if (num > kMaxCapacity - size_) { | 456 | 0 | OPENSSL_PUT_ERROR(CRYPTO, ERR_R_OVERFLOW); | 457 | 0 | return false; | 458 | 0 | } | 459 | 278k | size_t new_capacity = size_ + num; | 460 | | // No need to grow if we have room. | 461 | 278k | if (capacity_ >= new_capacity) { | 462 | 232k | return true; | 463 | 232k | } | 464 | | // Always grow to at least kDefaultSize to avoid several small mallocs at | 465 | | // the start. | 466 | 45.7k | new_capacity = std::max(new_capacity, std::min(kDefaultSize, kMaxCapacity)); | 467 | | // At least double the old capacity for linear amortized behavior. | 468 | 45.7k | if (capacity_ <= kMaxCapacity / 2) { | 469 | 45.7k | new_capacity = std::max(new_capacity, capacity_ * 2); | 470 | 45.7k | } | 471 | 45.7k | T *new_data = | 472 | 45.7k | reinterpret_cast<T *>(OPENSSL_malloc(new_capacity * sizeof(T))); | 473 | 45.7k | if (new_data == nullptr) { | 474 | 0 | return false; | 475 | 0 | } | 476 | 45.7k | size_t new_size = size_; | 477 | 45.7k | std::uninitialized_move(begin(), end(), new_data); | 478 | 45.7k | clear(); | 479 | 45.7k | data_ = new_data; | 480 | 45.7k | size_ = new_size; | 481 | 45.7k | capacity_ = new_capacity; | 482 | 45.7k | return true; | 483 | 45.7k | } |
Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<x509_lookup_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: by_dir.cc:bssl::Vector<std::__1::unique_ptr<bssl::(anonymous namespace)::ByDirEntry, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: by_dir.cc:bssl::Vector<bssl::(anonymous namespace)::ByDirEntry::CRLSuffix>::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<std::__1::unique_ptr<asn1_object_st, bssl::internal::Deleter> >::MaybeGrow(unsigned long) Unexecuted instantiation: policy.cc:bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>::MaybeGrow(unsigned long) Unexecuted instantiation: bssl::Vector<v3_ext_method const*>::MaybeGrow(unsigned long) |
484 | | |
485 | | // data_ is a pointer to `capacity_` objects of size `T`, the first `size_` of |
486 | | // which are constructed. |
487 | | T *data_ = nullptr; |
488 | | // `size_` is the number of elements stored in this Vector. |
489 | | size_t size_ = 0; |
490 | | // `capacity_` is the number of elements allocated in this Vector. |
491 | | size_t capacity_ = 0; |
492 | | }; |
493 | | |
494 | | // A PackedSize is an integer that can store values from 0 to N, represented as |
495 | | // a minimal-width integer. |
496 | | template <size_t N> |
497 | | using PackedSize = std::conditional_t< |
498 | | N <= 0xff, uint8_t, |
499 | | std::conditional_t<N <= 0xffff, uint16_t, |
500 | | std::conditional_t<N <= 0xffffffff, uint32_t, size_t>>>; |
501 | | |
502 | | // An InplaceVector is like a Vector, but stores up to N elements inline in the |
503 | | // object. It is inspired by std::inplace_vector in C++26. |
504 | | template <typename T, size_t N> |
505 | | class InplaceVector { |
506 | | public: |
507 | | using value_type = std::remove_cv_t<T>; |
508 | | |
509 | 3.16M | InplaceVector() = default; bssl::InplaceVector<unsigned short, 2ul>::InplaceVector() Line | Count | Source | 509 | 53.3k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 2ul>::InplaceVector() Line | Count | Source | 509 | 279k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 48ul>::InplaceVector() Line | Count | Source | 509 | 1.49M | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::InplaceVector() Line | Count | Source | 509 | 98.4k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 32ul>::InplaceVector() Line | Count | Source | 509 | 797k | InplaceVector() = default; |
bssl::InplaceVector<unsigned char, 12ul>::InplaceVector() Line | Count | Source | 509 | 374k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::InplaceVector() Line | Count | Source | 509 | 20.4k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::InplaceVector() Line | Count | Source | 509 | 10.8k | InplaceVector() = default; |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::InplaceVector() Line | Count | Source | 509 | 18.0k | InplaceVector() = default; |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::InplaceVector() Line | Count | Source | 509 | 18.0k | InplaceVector() = default; |
bssl::InplaceVector<crypto_iovec_st, 16ul>::InplaceVector() Line | Count | Source | 509 | 4.41k | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::InplaceVector() bssl::InplaceVector<unsigned char, 130ul>::InplaceVector() Line | Count | Source | 509 | 290 | InplaceVector() = default; |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::InplaceVector() |
510 | 36.1k | InplaceVector(const InplaceVector &other) { *this = other; } |
511 | 43.9k | InplaceVector(InplaceVector &&other) { *this = std::move(other); } |
512 | 3.24M | ~InplaceVector() { clear(); }bssl::InplaceVector<unsigned char, 48ul>::~InplaceVector() Line | Count | Source | 512 | 1.57M | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned short, 2ul>::~InplaceVector() Line | Count | Source | 512 | 53.3k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 2ul>::~InplaceVector() Line | Count | Source | 512 | 279k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::~InplaceVector() Line | Count | Source | 512 | 98.4k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 32ul>::~InplaceVector() Line | Count | Source | 512 | 797k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<unsigned char, 12ul>::~InplaceVector() Line | Count | Source | 512 | 374k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::~InplaceVector() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::~InplaceVector() Line | Count | Source | 512 | 20.4k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::~InplaceVector() Line | Count | Source | 512 | 10.8k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::~InplaceVector() Line | Count | Source | 512 | 18.0k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::~InplaceVector() Line | Count | Source | 512 | 18.0k | ~InplaceVector() { clear(); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::~InplaceVector() Line | Count | Source | 512 | 4.41k | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::~InplaceVector() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::~InplaceVector() bssl::InplaceVector<unsigned char, 130ul>::~InplaceVector() Line | Count | Source | 512 | 290 | ~InplaceVector() { clear(); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::~InplaceVector() |
513 | 293k | InplaceVector &operator=(const InplaceVector &other) { |
514 | 293k | if (this != &other) { |
515 | 293k | CopyFrom(other); |
516 | 293k | } |
517 | 293k | return *this; |
518 | 293k | } bssl::InplaceVector<unsigned char, 32ul>::operator=(bssl::InplaceVector<unsigned char, 32ul> const&) Line | Count | Source | 513 | 158k | InplaceVector &operator=(const InplaceVector &other) { | 514 | 158k | if (this != &other) { | 515 | 158k | CopyFrom(other); | 516 | 158k | } | 517 | 158k | return *this; | 518 | 158k | } |
bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul> const&) Line | Count | Source | 513 | 134k | InplaceVector &operator=(const InplaceVector &other) { | 514 | 134k | if (this != &other) { | 515 | 134k | CopyFrom(other); | 516 | 134k | } | 517 | 134k | return *this; | 518 | 134k | } |
|
519 | 119k | InplaceVector &operator=(InplaceVector &&other) { |
520 | 119k | clear(); |
521 | 119k | std::uninitialized_move(other.begin(), other.end(), data()); |
522 | 119k | size_ = other.size(); |
523 | 119k | return *this; |
524 | 119k | } bssl::InplaceVector<unsigned char, 48ul>::operator=(bssl::InplaceVector<unsigned char, 48ul>&&) Line | Count | Source | 519 | 119k | InplaceVector &operator=(InplaceVector &&other) { | 520 | 119k | clear(); | 521 | 119k | std::uninitialized_move(other.begin(), other.end(), data()); | 522 | 119k | size_ = other.size(); | 523 | 119k | return *this; | 524 | 119k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::operator=(bssl::InplaceVector<unsigned char, 2ul>&&) |
525 | | |
526 | 2.84M | const T *data() const { return reinterpret_cast<const T *>(storage_); }bssl::InplaceVector<unsigned char, 2ul>::data() const Line | Count | Source | 526 | 235k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::data() const bssl::InplaceVector<unsigned short, 2ul>::data() const Line | Count | Source | 526 | 52.8k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 48ul>::data() const Line | Count | Source | 526 | 952k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() const Line | Count | Source | 526 | 194k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() const Line | Count | Source | 526 | 1.40M | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() const bssl::InplaceVector<crypto_iovec_st, 16ul>::data() const Line | Count | Source | 526 | 8.83k | const T *data() const { return reinterpret_cast<const T *>(storage_); } |
|
527 | 8.72M | T *data() { return reinterpret_cast<T *>(storage_); }bssl::InplaceVector<unsigned char, 48ul>::data() Line | Count | Source | 527 | 3.44M | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 2ul>::data() Line | Count | Source | 527 | 781k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 12ul>::data() Line | Count | Source | 527 | 902k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::data() Line | Count | Source | 527 | 333k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned short, 2ul>::data() Line | Count | Source | 527 | 370k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<unsigned char, 32ul>::data() Line | Count | Source | 527 | 2.11M | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::data() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::data() Line | Count | Source | 527 | 237k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::data() Line | Count | Source | 527 | 219k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::data() Line | Count | Source | 527 | 33.8k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::data() Line | Count | Source | 527 | 264k | T *data() { return reinterpret_cast<T *>(storage_); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::data() Line | Count | Source | 527 | 17.6k | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::data() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::data() bssl::InplaceVector<unsigned char, 130ul>::data() Line | Count | Source | 527 | 1.45k | T *data() { return reinterpret_cast<T *>(storage_); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::data() |
528 | 4.38M | size_t size() const { return size_; }bssl::InplaceVector<unsigned char, 12ul>::size() const Line | Count | Source | 528 | 452k | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::size() const bssl::InplaceVector<unsigned short, 2ul>::size() const Line | Count | Source | 528 | 158k | size_t size() const { return size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::size() const Line | Count | Source | 528 | 111k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 2ul>::size() const Line | Count | Source | 528 | 295k | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 48ul>::size() const Line | Count | Source | 528 | 1.32M | size_t size() const { return size_; } |
bssl::InplaceVector<unsigned char, 32ul>::size() const Line | Count | Source | 528 | 1.45M | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::size() const bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::size() const Line | Count | Source | 528 | 186k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::size() const Line | Count | Source | 528 | 334k | size_t size() const { return size_; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::size() const Line | Count | Source | 528 | 47.0k | size_t size() const { return size_; } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::size() const Line | Count | Source | 528 | 13.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<unsigned char, 130ul>::size() const Line | Count | Source | 528 | 580 | size_t size() const { return size_; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::size() const bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::size() const Line | Count | Source | 528 | 8.16k | size_t size() const { return size_; } |
|
529 | 2.07M | static constexpr size_t capacity() { return N; }bssl::InplaceVector<unsigned char, 2ul>::capacity() Line | Count | Source | 529 | 122k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned short, 2ul>::capacity() Line | Count | Source | 529 | 105k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::capacity() Line | Count | Source | 529 | 111k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 32ul>::capacity() Line | Count | Source | 529 | 668k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 48ul>::capacity() Line | Count | Source | 529 | 634k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<unsigned char, 12ul>::capacity() Line | Count | Source | 529 | 274k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::capacity() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::capacity() bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::capacity() Line | Count | Source | 529 | 31.6k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::capacity() Line | Count | Source | 529 | 93.8k | static constexpr size_t capacity() { return N; } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::capacity() Line | Count | Source | 529 | 20.1k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::capacity() bssl::InplaceVector<crypto_iovec_st, 16ul>::capacity() Line | Count | Source | 529 | 4.41k | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::capacity() bssl::InplaceVector<unsigned char, 130ul>::capacity() Line | Count | Source | 529 | 290 | static constexpr size_t capacity() { return N; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::capacity() bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::capacity() Line | Count | Source | 529 | 8.16k | static constexpr size_t capacity() { return N; } |
|
530 | 498k | bool empty() const { return size_ == 0; }bssl::InplaceVector<unsigned char, 12ul>::empty() const Line | Count | Source | 530 | 79.3k | bool empty() const { return size_ == 0; } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::empty() const bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::empty() const Line | Count | Source | 530 | 4.16k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 2ul>::empty() const Line | Count | Source | 530 | 274k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 48ul>::empty() const Line | Count | Source | 530 | 2.42k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<unsigned char, 32ul>::empty() const Line | Count | Source | 530 | 122k | bool empty() const { return size_ == 0; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::empty() const Line | Count | Source | 530 | 15.8k | bool empty() const { return size_ == 0; } |
|
531 | | |
532 | | const T &operator[](size_t i) const { |
533 | | BSSL_CHECK(i < size_); |
534 | | return data()[i]; |
535 | | } |
536 | 522k | T &operator[](size_t i) { |
537 | 522k | BSSL_CHECK(i < size_); |
538 | 522k | return data()[i]; |
539 | 522k | } bssl::InplaceVector<unsigned short, 2ul>::operator[](unsigned long) Line | Count | Source | 536 | 211k | T &operator[](size_t i) { | 537 | 211k | BSSL_CHECK(i < size_); | 538 | 211k | return data()[i]; | 539 | 211k | } |
bssl::InplaceVector<unsigned char, 2ul>::operator[](unsigned long) Line | Count | Source | 536 | 54.6k | T &operator[](size_t i) { | 537 | 54.6k | BSSL_CHECK(i < size_); | 538 | 54.6k | return data()[i]; | 539 | 54.6k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::operator[](unsigned long) Line | Count | Source | 536 | 9.27k | T &operator[](size_t i) { | 537 | 9.27k | BSSL_CHECK(i < size_); | 538 | 9.27k | return data()[i]; | 539 | 9.27k | } |
bssl::InplaceVector<unsigned char, 12ul>::operator[](unsigned long) Line | Count | Source | 536 | 48.3k | T &operator[](size_t i) { | 537 | 48.3k | BSSL_CHECK(i < size_); | 538 | 48.3k | return data()[i]; | 539 | 48.3k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::operator[](unsigned long) Line | Count | Source | 536 | 82.7k | T &operator[](size_t i) { | 537 | 82.7k | BSSL_CHECK(i < size_); | 538 | 82.7k | return data()[i]; | 539 | 82.7k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::operator[](unsigned long) Line | Count | Source | 536 | 2.80k | T &operator[](size_t i) { | 537 | 2.80k | BSSL_CHECK(i < size_); | 538 | 2.80k | return data()[i]; | 539 | 2.80k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::operator[](unsigned long) Line | Count | Source | 536 | 112k | T &operator[](size_t i) { | 537 | 112k | BSSL_CHECK(i < size_); | 538 | 112k | return data()[i]; | 539 | 112k | } |
|
540 | | |
541 | | T &front() { |
542 | | BSSL_CHECK(size_ != 0); |
543 | | return data()[0]; |
544 | | } |
545 | | const T &front() const { |
546 | | BSSL_CHECK(size_ != 0); |
547 | | return data()[0]; |
548 | | } |
549 | | T &back() { |
550 | | BSSL_CHECK(size_ != 0); |
551 | | return data()[size_ - 1]; |
552 | | } |
553 | | const T &back() const { |
554 | | BSSL_CHECK(size_ != 0); |
555 | | return data()[size_ - 1]; |
556 | | } |
557 | | |
558 | 318k | T *begin() { return data(); }bssl::InplaceVector<unsigned char, 48ul>::begin() Line | Count | Source | 558 | 119k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::begin() Line | Count | Source | 558 | 2.46k | T *begin() { return data(); } |
bssl::InplaceVector<unsigned char, 2ul>::begin() Line | Count | Source | 558 | 52.6k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::begin() Line | Count | Source | 558 | 4.80k | T *begin() { return data(); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::begin() Line | Count | Source | 558 | 19.9k | T *begin() { return data(); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::begin() Line | Count | Source | 558 | 119k | T *begin() { return data(); } |
|
559 | | const T *begin() const { return data(); } |
560 | 325k | T *end() { return data() + size_; }bssl::InplaceVector<unsigned char, 48ul>::end() Line | Count | Source | 560 | 119k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::end() Line | Count | Source | 560 | 4.93k | T *end() { return data() + size_; } |
bssl::InplaceVector<unsigned char, 2ul>::end() Line | Count | Source | 560 | 101k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::end() Line | Count | Source | 560 | 4.80k | T *end() { return data() + size_; } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::end() Line | Count | Source | 560 | 19.9k | T *end() { return data() + size_; } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::end() Line | Count | Source | 560 | 75.3k | T *end() { return data() + size_; } |
|
561 | | const T *end() const { return data() + size_; } |
562 | | |
563 | 4.96M | void clear() { Shrink(0); }bssl::InplaceVector<unsigned char, 48ul>::clear() Line | Count | Source | 563 | 2.21M | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::clear() Line | Count | Source | 563 | 204k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned short, 2ul>::clear() Line | Count | Source | 563 | 53.3k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 2ul>::clear() Line | Count | Source | 563 | 449k | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 32ul>::clear() Line | Count | Source | 563 | 1.35M | void clear() { Shrink(0); } |
bssl::InplaceVector<unsigned char, 12ul>::clear() Line | Count | Source | 563 | 568k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::clear() bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::clear() Line | Count | Source | 563 | 33.1k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::clear() Line | Count | Source | 563 | 10.8k | void clear() { Shrink(0); } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::clear() Line | Count | Source | 563 | 52.7k | void clear() { Shrink(0); } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::clear() Line | Count | Source | 563 | 18.0k | void clear() { Shrink(0); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::clear() Line | Count | Source | 563 | 8.83k | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::clear() Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::clear() bssl::InplaceVector<unsigned char, 130ul>::clear() Line | Count | Source | 563 | 290 | void clear() { Shrink(0); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::clear() |
564 | | |
565 | | void pop_back() { |
566 | | BSSL_CHECK(size_ != 0); |
567 | | Shrink(size_ - 1); |
568 | | } |
569 | | |
570 | | // Shrink resizes the vector to `new_size`, which must not be larger than the |
571 | | // current size. Unlike `Resize`, this can be called when `T` is not |
572 | | // default-constructible. |
573 | 5.01M | void Shrink(size_t new_size) { |
574 | 5.01M | BSSL_CHECK(new_size <= size_); |
575 | 5.01M | std::destroy_n(data() + new_size, size_ - new_size); |
576 | 5.01M | size_ = static_cast<PackedSize<N>>(new_size); |
577 | 5.01M | } bssl::InplaceVector<unsigned char, 48ul>::Shrink(unsigned long) Line | Count | Source | 573 | 2.21M | void Shrink(size_t new_size) { | 574 | 2.21M | BSSL_CHECK(new_size <= size_); | 575 | 2.21M | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 2.21M | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 2.21M | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::Shrink(unsigned long) Line | Count | Source | 573 | 204k | void Shrink(size_t new_size) { | 574 | 204k | BSSL_CHECK(new_size <= size_); | 575 | 204k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 204k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 204k | } |
bssl::InplaceVector<unsigned short, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 53.3k | void Shrink(size_t new_size) { | 574 | 53.3k | BSSL_CHECK(new_size <= size_); | 575 | 53.3k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 53.3k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 53.3k | } |
bssl::InplaceVector<unsigned char, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 449k | void Shrink(size_t new_size) { | 574 | 449k | BSSL_CHECK(new_size <= size_); | 575 | 449k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 449k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 449k | } |
bssl::InplaceVector<unsigned char, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 1.35M | void Shrink(size_t new_size) { | 574 | 1.35M | BSSL_CHECK(new_size <= size_); | 575 | 1.35M | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 1.35M | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 1.35M | } |
bssl::InplaceVector<unsigned char, 12ul>::Shrink(unsigned long) Line | Count | Source | 573 | 568k | void Shrink(size_t new_size) { | 574 | 568k | BSSL_CHECK(new_size <= size_); | 575 | 568k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 568k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 568k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Shrink(unsigned long) bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 33.1k | void Shrink(size_t new_size) { | 574 | 33.1k | BSSL_CHECK(new_size <= size_); | 575 | 33.1k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 33.1k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 33.1k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::Shrink(unsigned long) Line | Count | Source | 573 | 10.8k | void Shrink(size_t new_size) { | 574 | 10.8k | BSSL_CHECK(new_size <= size_); | 575 | 10.8k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 10.8k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 10.8k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::Shrink(unsigned long) Line | Count | Source | 573 | 52.7k | void Shrink(size_t new_size) { | 574 | 52.7k | BSSL_CHECK(new_size <= size_); | 575 | 52.7k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 52.7k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 52.7k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::Shrink(unsigned long) Line | Count | Source | 573 | 61.9k | void Shrink(size_t new_size) { | 574 | 61.9k | BSSL_CHECK(new_size <= size_); | 575 | 61.9k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 61.9k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 61.9k | } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::Shrink(unsigned long) Line | Count | Source | 573 | 8.83k | void Shrink(size_t new_size) { | 574 | 8.83k | BSSL_CHECK(new_size <= size_); | 575 | 8.83k | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 8.83k | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 8.83k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Shrink(unsigned long) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Shrink(unsigned long) bssl::InplaceVector<unsigned char, 130ul>::Shrink(unsigned long) Line | Count | Source | 573 | 290 | void Shrink(size_t new_size) { | 574 | 290 | BSSL_CHECK(new_size <= size_); | 575 | 290 | std::destroy_n(data() + new_size, size_ - new_size); | 576 | 290 | size_ = static_cast<PackedSize<N>>(new_size); | 577 | 290 | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::Shrink(unsigned long) |
578 | | |
579 | | // TryResize resizes the vector to `new_size` and returns true, or returns |
580 | | // false if `new_size` is too large. Any newly-added elements are |
581 | | // value-initialized. |
582 | 6.65k | [[nodiscard]] bool TryResize(size_t new_size) { |
583 | 6.65k | if (new_size <= size_) { |
584 | 0 | Shrink(new_size); |
585 | 0 | return true; |
586 | 0 | } |
587 | 6.65k | if (new_size > capacity()) { |
588 | 0 | return false; |
589 | 0 | } |
590 | 6.65k | std::uninitialized_value_construct_n(data() + size_, new_size - size_); |
591 | 6.65k | size_ = static_cast<PackedSize<N>>(new_size); |
592 | 6.65k | return true; |
593 | 6.65k | } |
594 | | |
595 | | // TryResizeForOverwrite behaves like `TryResize`, but newly-added elements |
596 | | // are default-initialized, so POD types may contain uninitialized values that |
597 | | // the caller is responsible for filling in. |
598 | 214k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { |
599 | 214k | if (new_size <= size_) { |
600 | 141 | Shrink(new_size); |
601 | 141 | return true; |
602 | 141 | } |
603 | 214k | if (new_size > capacity()) { |
604 | 0 | return false; |
605 | 0 | } |
606 | 214k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); |
607 | 214k | size_ = static_cast<PackedSize<N>>(new_size); |
608 | 214k | return true; |
609 | 214k | } bssl::InplaceVector<unsigned char, 32ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 598 | 100k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 599 | 100k | if (new_size <= size_) { | 600 | 20 | Shrink(new_size); | 601 | 20 | return true; | 602 | 20 | } | 603 | 100k | if (new_size > capacity()) { | 604 | 0 | return false; | 605 | 0 | } | 606 | 100k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 607 | 100k | size_ = static_cast<PackedSize<N>>(new_size); | 608 | 100k | return true; | 609 | 100k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 598 | 113k | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 599 | 113k | if (new_size <= size_) { | 600 | 121 | Shrink(new_size); | 601 | 121 | return true; | 602 | 121 | } | 603 | 113k | if (new_size > capacity()) { | 604 | 0 | return false; | 605 | 0 | } | 606 | 113k | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 607 | 113k | size_ = static_cast<PackedSize<N>>(new_size); | 608 | 113k | return true; | 609 | 113k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::TryResizeForOverwrite(unsigned long) bssl::InplaceVector<unsigned char, 130ul>::TryResizeForOverwrite(unsigned long) Line | Count | Source | 598 | 290 | [[nodiscard]] bool TryResizeForOverwrite(size_t new_size) { | 599 | 290 | if (new_size <= size_) { | 600 | 0 | Shrink(new_size); | 601 | 0 | return true; | 602 | 0 | } | 603 | 290 | if (new_size > capacity()) { | 604 | 0 | return false; | 605 | 0 | } | 606 | 290 | std::uninitialized_default_construct_n(data() + size_, new_size - size_); | 607 | 290 | size_ = static_cast<PackedSize<N>>(new_size); | 608 | 290 | return true; | 609 | 290 | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 195ul>::TryResizeForOverwrite(unsigned long) |
610 | | |
611 | | // TryCopyFrom sets the vector to a copy of `in` and returns true, or returns |
612 | | // false if `in` is too large. |
613 | | // |
614 | | // `in` may not alias `this`. |
615 | 1.39M | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { |
616 | 1.39M | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); |
617 | 1.39M | if (in.size() > capacity()) { |
618 | 10.0k | return false; |
619 | 10.0k | } |
620 | 1.38M | clear(); |
621 | 1.38M | std::uninitialized_copy(in.begin(), in.end(), data()); |
622 | 1.38M | size_ = in.size(); |
623 | 1.38M | return true; |
624 | 1.39M | } bssl::InplaceVector<unsigned char, 2ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 117k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 117k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 117k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 117k | clear(); | 621 | 117k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 117k | size_ = in.size(); | 623 | 117k | return true; | 624 | 117k | } |
bssl::InplaceVector<unsigned char, 12ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 194k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 194k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 194k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 194k | clear(); | 621 | 194k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 194k | size_ = in.size(); | 623 | 194k | return true; | 624 | 194k | } |
bssl::InplaceVector<unsigned char, 32ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 568k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 568k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 568k | if (in.size() > capacity()) { | 618 | 9.97k | return false; | 619 | 9.97k | } | 620 | 558k | clear(); | 621 | 558k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 558k | size_ = in.size(); | 623 | 558k | return true; | 624 | 568k | } |
bssl::InplaceVector<unsigned char, 48ul>::TryCopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 615 | 514k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 514k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 514k | if (in.size() > capacity()) { | 618 | 32 | return false; | 619 | 32 | } | 620 | 514k | clear(); | 621 | 514k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 514k | size_ = in.size(); | 623 | 514k | return true; | 624 | 514k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::TryCopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<crypto_iovec_st, 16ul>::TryCopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) Line | Count | Source | 615 | 4.41k | [[nodiscard]] bool TryCopyFrom(Span<const T> in) { | 616 | 4.41k | BSSL_CHECK(!spans_alias(MakeConstSpan(*this), in)); | 617 | 4.41k | if (in.size() > capacity()) { | 618 | 0 | return false; | 619 | 0 | } | 620 | 4.41k | clear(); | 621 | 4.41k | std::uninitialized_copy(in.begin(), in.end(), data()); | 622 | 4.41k | size_ = in.size(); | 623 | 4.41k | return true; | 624 | 4.41k | } |
|
625 | | |
626 | | // TryAppend appends the vector by a copy of `in` and returns true, or |
627 | | // returns false if `in` is too large. |
628 | 0 | [[nodiscard]] bool TryAppend(Span<const T> in) { |
629 | 0 | if (in.size() > capacity() - size()) { |
630 | 0 | return false; |
631 | 0 | } |
632 | 0 | std::uninitialized_copy(in.begin(), in.end(), &data()[size_]); |
633 | 0 | size_ += in.size(); |
634 | 0 | return true; |
635 | 0 | } Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::TryAppend(bssl::Span<unsigned char const, 18446744073709551615ul>) |
636 | | |
637 | | // TryPushBack appends `val` to the vector and returns a pointer to the |
638 | | // newly-inserted value, or nullptr if the vector is at capacity. |
639 | 376k | [[nodiscard]] T *TryPushBack(T val) { |
640 | 376k | if (size() >= capacity()) { |
641 | 0 | return nullptr; |
642 | 0 | } |
643 | 376k | T *ret = &data()[size_]; |
644 | 376k | new (ret) T(std::move(val)); |
645 | 376k | size_++; |
646 | 376k | return ret; |
647 | 376k | } bssl::InplaceVector<unsigned char, 2ul>::TryPushBack(unsigned char) Line | Count | Source | 639 | 5.07k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 5.07k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 5.07k | T *ret = &data()[size_]; | 644 | 5.07k | new (ret) T(std::move(val)); | 645 | 5.07k | size_++; | 646 | 5.07k | return ret; | 647 | 5.07k | } |
bssl::InplaceVector<unsigned short, 2ul>::TryPushBack(unsigned short) Line | Count | Source | 639 | 105k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 105k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 105k | T *ret = &data()[size_]; | 644 | 105k | new (ret) T(std::move(val)); | 645 | 105k | size_++; | 646 | 105k | return ret; | 647 | 105k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>, 6ul>::TryPushBack(std::__1::unique_ptr<bssl::SSLKeyShare, bssl::internal::Deleter>) Line | Count | Source | 639 | 111k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 111k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 111k | T *ret = &data()[size_]; | 644 | 111k | new (ret) T(std::move(val)); | 645 | 111k | size_++; | 646 | 111k | return ret; | 647 | 111k | } |
bssl::InplaceVector<bssl::DTLSOutgoingMessage, 7ul>::TryPushBack(bssl::DTLSOutgoingMessage) Line | Count | Source | 639 | 31.6k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 31.6k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 31.6k | T *ret = &data()[size_]; | 644 | 31.6k | new (ret) T(std::move(val)); | 645 | 31.6k | size_++; | 646 | 31.6k | return ret; | 647 | 31.6k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::TryPushBack(bssl::DTLSRecordNumber) Line | Count | Source | 639 | 93.8k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 93.8k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 93.8k | T *ret = &data()[size_]; | 644 | 93.8k | new (ret) T(std::move(val)); | 645 | 93.8k | size_++; | 646 | 93.8k | return ret; | 647 | 93.8k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::TryPushBack(bssl::DTLSSentRecord) Line | Count | Source | 639 | 20.1k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 20.1k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 20.1k | T *ret = &data()[size_]; | 644 | 20.1k | new (ret) T(std::move(val)); | 645 | 20.1k | size_++; | 646 | 20.1k | return ret; | 647 | 20.1k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::TryPushBack(std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>) Line | Count | Source | 639 | 8.16k | [[nodiscard]] T *TryPushBack(T val) { | 640 | 8.16k | if (size() >= capacity()) { | 641 | 0 | return nullptr; | 642 | 0 | } | 643 | 8.16k | T *ret = &data()[size_]; | 644 | 8.16k | new (ret) T(std::move(val)); | 645 | 8.16k | size_++; | 646 | 8.16k | return ret; | 647 | 8.16k | } |
|
648 | | |
649 | | // The following methods behave like their `Try*` counterparts, but abort the |
650 | | // program on failure. |
651 | 6.65k | void Resize(size_t size) { BSSL_CHECK(TryResize(size)); } |
652 | 213k | void ResizeForOverwrite(size_t size) { |
653 | 213k | BSSL_CHECK(TryResizeForOverwrite(size)); |
654 | 213k | } bssl::InplaceVector<unsigned char, 32ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 652 | 99.6k | void ResizeForOverwrite(size_t size) { | 653 | 99.6k | BSSL_CHECK(TryResizeForOverwrite(size)); | 654 | 99.6k | } |
bssl::InplaceVector<unsigned char, 48ul>::ResizeForOverwrite(unsigned long) Line | Count | Source | 652 | 113k | void ResizeForOverwrite(size_t size) { | 653 | 113k | BSSL_CHECK(TryResizeForOverwrite(size)); | 654 | 113k | } |
Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::ResizeForOverwrite(unsigned long) |
655 | 604k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); }Unexecuted instantiation: bssl::InplaceVector<unsigned char, 2ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 12ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 151k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
bssl::InplaceVector<unsigned char, 32ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 214k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
Unexecuted instantiation: bssl::InplaceVector<unsigned short, 6ul>::CopyFrom(bssl::Span<unsigned short const, 18446744073709551615ul>) bssl::InplaceVector<unsigned char, 48ul>::CopyFrom(bssl::Span<unsigned char const, 18446744073709551615ul>) Line | Count | Source | 655 | 233k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
bssl::InplaceVector<crypto_iovec_st, 16ul>::CopyFrom(bssl::Span<crypto_iovec_st const, 18446744073709551615ul>) Line | Count | Source | 655 | 4.41k | void CopyFrom(Span<const T> in) { BSSL_CHECK(TryCopyFrom(in)); } |
|
656 | 0 | void Append(Span<const T> in) { BSSL_CHECK(TryAppend(in)); }Unexecuted instantiation: bssl::InplaceVector<unsigned char, 16ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 64ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) Unexecuted instantiation: bssl::InplaceVector<unsigned char, 8ul>::Append(bssl::Span<unsigned char const, 18446744073709551615ul>) |
657 | 127k | T &PushBack(T val) { |
658 | 127k | T *ret = TryPushBack(std::move(val)); |
659 | 127k | BSSL_CHECK(ret != nullptr); |
660 | 127k | return *ret; |
661 | 127k | } bssl::InplaceVector<unsigned char, 2ul>::PushBack(unsigned char) Line | Count | Source | 657 | 5.07k | T &PushBack(T val) { | 658 | 5.07k | T *ret = TryPushBack(std::move(val)); | 659 | 5.07k | BSSL_CHECK(ret != nullptr); | 660 | 5.07k | return *ret; | 661 | 5.07k | } |
bssl::InplaceVector<bssl::DTLSRecordNumber, 32ul>::PushBack(bssl::DTLSRecordNumber) Line | Count | Source | 657 | 93.8k | T &PushBack(T val) { | 658 | 93.8k | T *ret = TryPushBack(std::move(val)); | 659 | 93.8k | BSSL_CHECK(ret != nullptr); | 660 | 93.8k | return *ret; | 661 | 93.8k | } |
bssl::InplaceVector<bssl::DTLSSentRecord, 32ul>::PushBack(bssl::DTLSSentRecord) Line | Count | Source | 657 | 20.1k | T &PushBack(T val) { | 658 | 20.1k | T *ret = TryPushBack(std::move(val)); | 659 | 20.1k | BSSL_CHECK(ret != nullptr); | 660 | 20.1k | return *ret; | 661 | 20.1k | } |
bssl::InplaceVector<std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>, 2ul>::PushBack(std::__1::unique_ptr<bssl::DTLSWriteEpoch, bssl::internal::Deleter>) Line | Count | Source | 657 | 8.16k | T &PushBack(T val) { | 658 | 8.16k | T *ret = TryPushBack(std::move(val)); | 659 | 8.16k | BSSL_CHECK(ret != nullptr); | 660 | 8.16k | return *ret; | 661 | 8.16k | } |
|
662 | | |
663 | | // EraseIf removes all elements that satisfy the predicate `pred`. |
664 | | template <typename Pred> |
665 | 43.8k | void EraseIf(Pred pred) { |
666 | 43.8k | auto it = std::remove_if(begin(), end(), pred); |
667 | 43.8k | Shrink(it - begin()); |
668 | 43.8k | } |
669 | | |
670 | | private: |
671 | | alignas(T) char storage_[sizeof(T[N])]; |
672 | | PackedSize<N> size_ = 0; |
673 | | }; |
674 | | |
675 | | // A MaybeInplaceArray is like an `Array`, but backed by an `InplaceVector` if |
676 | | // `size() <= N`, and by an `Array` if `size() > N`. |
677 | | template <typename T, size_t N> |
678 | | class MaybeInplaceArray { |
679 | | public: |
680 | | // CopyFrom replaces the array with a newly-allocated copy of `in`. It returns |
681 | | // true on success and false on error. |
682 | | // |
683 | | // `in` may not alias `this`. |
684 | 4.41k | [[nodiscard]] bool CopyFrom(Span<const T> in) { |
685 | 4.41k | if (in.size() <= N) { |
686 | 4.41k | small_.CopyFrom(in); |
687 | 4.41k | large_.Reset(); |
688 | 4.41k | } else { |
689 | 0 | if (!large_.CopyFrom(in)) { |
690 | 0 | return false; |
691 | 0 | } |
692 | 0 | small_.clear(); |
693 | 0 | } |
694 | 4.41k | return true; |
695 | 4.41k | } |
696 | | |
697 | | // Minimal methods to allow conversion to a `Span`. |
698 | 4.41k | const T *data() const { return IsSmall() ? small_.data() : large_.data(); } |
699 | 4.41k | T *data() { return IsSmall() ? small_.data() : large_.data(); } |
700 | 8.83k | size_t size() const { return IsSmall() ? small_.size() : large_.size(); } |
701 | | |
702 | | private: |
703 | 17.6k | bool IsSmall() const { return large_.empty(); } |
704 | | |
705 | | // TODO(crbug.com/548222332): Optimize storage by putting this on the stack. |
706 | | // Invariant: at least one of these two is empty. |
707 | | Array<T> large_; |
708 | | InplaceVector<T, N> small_; |
709 | | }; |
710 | | |
711 | | BSSL_NAMESPACE_END |
712 | | |
713 | | #endif // OPENSSL_HEADER_CRYPTO_MEM_INTERNAL_H |