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

Remove manual ref counting for BundleResource #695

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

achristoforides
Copy link
Member

Signed-off-by: The MathWorks, Inc. alchrist@mathworks.com

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2022

Codecov Report

Merging #695 (bba0518) into development (954936f) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #695      +/-   ##
===============================================
- Coverage        90.46%   90.36%   -0.10%     
===============================================
  Files              248      233      -15     
  Lines            13643    13381     -262     
===============================================
- Hits             12342    12092     -250     
+ Misses            1301     1289      -12     
Impacted Files Coverage Δ
...ramework/include/cppmicroservices/BundleResource.h 100.00% <100.00%> (ø)
framework/src/bundle/BundleResource.cpp 95.10% <100.00%> (-0.42%) ⬇️
...ativeServices/src/manager/ComponentManagerImpl.hpp 84.61% <0.00%> (-7.70%) ⬇️
...anager/BundleOrPrototypeComponentConfiguration.cpp 80.14% <0.00%> (-2.14%) ⬇️
...arativeServices/src/metadata/ReferenceMetadata.cpp 88.57% <0.00%> (-2.13%) ⬇️
framework/src/service/ServiceRegistry.cpp 91.28% <0.00%> (-2.06%) ⬇️
...src/manager/states/CCUnsatisfiedReferenceState.hpp 92.30% <0.00%> (-1.45%) ⬇️
...es/src/manager/SingletonComponentConfiguration.cpp 90.83% <0.00%> (-1.42%) ⬇️
framework/src/service/ServiceReferenceBase.cpp 96.02% <0.00%> (-1.33%) ⬇️
...ervices/src/manager/ComponentConfigurationImpl.cpp 97.90% <0.00%> (-1.11%) ⬇️
... and 69 more

Comment on lines 132 to 137
BundleResource& BundleResource::operator=(const BundleResource& resource)
{
BundleResourcePrivate* curr_d = d;
d = resource.d;
++d->ref;

if (!--curr_d->ref)
delete curr_d;

return *this;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can the copy assignment operator be =default? I don't think we need a user-defined implementation for this now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That seems like the right change here.

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
@achristoforides achristoforides merged commit 74f915b into development Jun 27, 2022
@achristoforides achristoforides deleted the shared-ptr-for-bundle-resource branch June 27, 2022 18:20
insi-eb pushed a commit to insi-eb/CppMicroServices-cpp14 that referenced this pull request Jan 31, 2023
* Removed manual ref counting for BundleResource

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>

* Made changes requested by reviewer

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
jeffdiclemente pushed a commit that referenced this pull request Jan 31, 2023
* Removed manual ref counting for BundleResource



* Made changes requested by reviewer

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
Co-authored-by: Alexander Christoforides <38366659+achristoforides@users.noreply.github.com>
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.

None yet

4 participants