-
Notifications
You must be signed in to change notification settings - Fork 38.7k
No need to use OpenSSL malloc/free #10058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Please be aware the we use the [trivial] label for changes that are essentially non-code changes. i.e fixing typos. This PR would not be considered trivial. |
|
Ack. will remove the trivial marker when I update the PR for the apparently broken test. |
src/util.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK it was slightly wrong to free the ppmutexOpenSSL via OPENSSL_free. IMO only objects alloced by OPENSSL_malloc() should use OPENSSL_free(). This change makes sense.
I was wrong: It is currently (master) alloced with OPENSSL_malloc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is allocated via OPENSSL_malloc
ppmutexOpenSSL = (CCriticalSection**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(CCriticalSection*));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is allocated via OPENSSL_malloc
Oh. Right.. it was. Nervermind then.
|
utACK 0765b6c9f08c5bac848ba8ac7c03471513fa4654 |
|
Bump, for one less OpenSSL eyesore |
src/util.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably cleaner to just use a std::unique_ptr<CCriticalSection[]>
src/util.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then here ppmutexOpenSSL.reset(new CCriticalSection[CRYPTO_num_locks()]); I think is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. I always like shaving lines off.
|
utACK 6d5dd60 |
6d5dd60 No need to use OpenSSL malloc/free (Thomas Snider) Tree-SHA512: 29f790067ffd5a10a8e1a621318a0ba445691f57c804aa3b7c8ca372c8408d8c7fe703c42b48018e400fc32e3feff5ab401d97433910ce2c50e69da0b8a6662e
6d5dd60 No need to use OpenSSL malloc/free (Thomas Snider) Tree-SHA512: 29f790067ffd5a10a8e1a621318a0ba445691f57c804aa3b7c8ca372c8408d8c7fe703c42b48018e400fc32e3feff5ab401d97433910ce2c50e69da0b8a6662e
The set of objects used in the OpenSSL locking callback do not need to be allocated using the OpenSSL allocator.