Place a typed pointer instead of a bool into etl::typed_storage
#1170
Replies: 5 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
|
My only issue would be the possibility of a larger memory footprint. |
Beta Was this translation helpful? Give feedback.
-
|
That sounds like an interesting idea. I'll take a look at that tomorrow. |
Beta Was this translation helpful? Give feedback.
-
|
I've modified |
Beta Was this translation helpful? Give feedback.
-
|
Your changes are reasonable. I overlooked that that I had added new conditions for the type stored. |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
Hi! in OpenBSW project (https://github.com/eclipse-openbsw/openbsw) we've lately replaced ESTD with ETL library. As part of the migration we were replacing
estd::typed_memwithetl::typed_storage. We're using this class for wrapping our main configuration components (we're calling them lifecycle components) that build up the system. This helps us to e.g. avoid the compiler to generate unwanted default destructor code and might in future also help to determine and control more precisely the point in time when actually such components are created.Unfortunately the current implementation of

etl::typed_storageis not really helpful for debugging the wrapped typed instances nor is it easy for performing detailed RAM analysis (how big are the members of the wrapped structs) on such binary blobs. This is how variables are displayed in an Eclipse debug IDE for ARM gcc:The idea is now to replace member

valid(typebool) with a membervaluewhich is a typed pointer that is set once there's a valid instance. The variable would then be displayed like:Sure, the pointer member is obviously bigger. But on 32-bit architectures this might, due to required alignment, not necessarily lead to more RAM consumption. Therefore, what do you think about this idea?
Beta Was this translation helpful? Give feedback.
All reactions