Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2015-05-05 20:27:54 +0300
committerAdam Langley <agl@google.com>2015-05-05 21:30:03 +0300
commit517da2f1efc91b179dfb1898f826b18a6a38f547 (patch)
treeb8c69fd3f4c035570b0307e357e0d87084522871 /crypto/bio
parente60e2a483b3153f2de462371713cbf16e2764541 (diff)
Add |BIO_up_ref| and |EVP_PKEY_up_ref|.
This avoids callers having to worry about |CRYPTO_add| and what the correct lock to use it with is. (Esp since we'll probably change the way that reference counts work in the future.) Change-Id: I972bf0cc3be6099e0255e64a0fd50249062d1eb4 Reviewed-on: https://boringssl-review.googlesource.com/4623 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/bio/bio.c b/crypto/bio/bio.c
index 2fcad6cc..48c1466d 100644
--- a/crypto/bio/bio.c
+++ b/crypto/bio/bio.c
@@ -126,6 +126,11 @@ int BIO_free(BIO *bio) {
return 1;
}
+BIO *BIO_up_ref(BIO *bio) {
+ CRYPTO_add(&bio->references, 1, CRYPTO_LOCK_BIO);
+ return bio;
+}
+
void BIO_vfree(BIO *bio) {
BIO_free(bio);
}