Situation shared_ptr in embedded systems
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- embedded-iot
Research direction
Start by reviewing the proof of concept in https://github.com/jplcz/smart_ptr/pull/1/files and compare its proposed nothrow constructors, try-prefixed functions, and try_reset behavior with the smart_ptr module. Done would mean a maintainer-approved design and corresponding library changes that support failure handling without exception-based APIs.
Written by the indexing model from the issue text.
Description
I have created Proof of Concept inside https://github.com/jplcz/smart_ptr/pull/1/files
General idea is to allow "nothrow" allocation of shared_ptr class of objects from smart_ptr library, however without need to go through expensive exception handling code, which can be ofter either disabled or it's usage available only in certain scopes (e.g. kernel mode code).
In such cases, developers may want to simply handle errors instead of crashing entire thread.
I have also added BOOST_SP_EMBEDDED ifdefs, which allow developer to disable any APIs which may throw. Currently it requires using sp_nothrow_tag to constructors. Plain functions get try prefix, such as try_make_unique or try_make_shared. If anything fails, they simply return empty smart pointer. Another method is reset, which now becomes try_reset - instead of leaving object in "partial" state, it doesn't modify the object if memory allocated would fail.
Are there any plans to introduce such feature in the library ?
- Dominant language
- C++
- Stars
- 111
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/smart_ptr
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in boostorg/smart_ptr
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MerginMaps/mobile#4741 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Icinga/icinga2#11077 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
agent:WSL bug linux LOW ui
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ArduPilot/ardupilot#34617 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day