Skip to content
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

Apply the rule of 3/5/0 to JByteArrayCritical et al. #395

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

fabrice102
Copy link
Contributor

Issue #, if available: N/A

Description of changes:

Apply the rule of 3/5/0 to JByteArrayCritical, SimpleBuffer, JBinaryBlob, JIOBlobs. This ensures that these objects cannot be copied.

Before, if they were copied (e.g., due to being passed as argument to a function), the destructor would be called twice, which would release the critical region twice or which may release the critical region while another part of the code is still using it.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@fabrice102 fabrice102 requested a review from a team as a code owner August 5, 2024 15:39
Apply the [rule of 3/5/0](https://en.cppreference.com/w/cpp/language/rule_of_three)
to JByteArrayCritical, SimpleBuffer, JBinaryBlob, JIOBlobs.
This ensures that these objects cannot be copied.

Before, if they were copied (e.g., due to being passed as argument to a
function), the destructor would be called twice, which would release the
critical region twice or which may release the critical region while
another part of the code is still using it.
@fabrice102 fabrice102 force-pushed the JByteArrayCritical-rule-of-three branch from 70cf179 to ef73412 Compare August 5, 2024 16:08
csrc/buffer.h Outdated Show resolved Hide resolved
csrc/buffer.h Show resolved Hide resolved
@amirhosv amirhosv merged commit d71028c into corretto:main Aug 6, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants