You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.
So I just stumbled upon the xpcc xpcc::SmartPointer which confused me for a while, until I had a look at the implementation. While it might not have been the case in 2009, currently a smart pointer is a pretty specific concept used in the c++ standard library.
I just assumed, that a xpcc::SmartPointer would act the same as the std::shared_ptr which it does not. I figured that out after searching for the point at which memory to be managed by the xpcc::SmartPointer was allocated. This point does not exist, as the xpcc::SmartPointer exclusively manages a runtime sized uint8_t array which it allocates internally.
Thus it makes sense to keep the xpcc::SmartPointer implementation in the container directory.
The naming however is imho very misleading.
I therefore propose the rename xpcc::SmartPointer. I haven't come up with a good enough name yet, but some possibilities are:
xpcc::SharedMemory
xpcc::ManagedMemory
xpcc::ManagedSharedMemory
Does anyone have a better suggestion, or does anyone oppose a name change?
The text was updated successfully, but these errors were encountered:
+1. I was also extremely confused by the naming of this thing, and I very much dislike its internal implementation. std::shared_ptr alongside std::make_shared are the only acceptable smart pointer for wide use.
Of course, we would have to port it to AVR, since we currently have no Standard Library (also see #20).
If I recall correctly, the xpcc::SmartPointer is not templated for a type, so that it can be passed to the xpcc::Dispatcher. It was meant as an internal XPCC mechanism to keep track of memory, and is not meant for wider use in the framework.
Am 30.09.2015 um 20:34 schrieb Kevin Laeufer [email protected]:
I therefore propose the rename xpcc::SmartPointer. I haven't come up with a good enough name yet, but some possibilities are:
xpcc::SharedMemory
xpcc::ManagedMemory
xpcc::ManagedSharedMemory
Does anyone have a better suggestion, or does anyone oppose a name change?
I haven't had a Look into the exact implementation, but the concept you described reminds on what boost is calling scoped_array<uint8_t> for many, many years.
(size must be 2 for AVRs).
The support for that was secretly enabled by me in the innocent looking commit 6f2dfa9 ;-)
This was a hack to allow internal sharing of large amounts of memory (of variable length!) safely without copying it.
This obviously only works for a local event loop, something that isn't currently supported very well, but can be implemented using an empty implementation of xpcc::BackendInterface.
So I just stumbled upon the xpcc
xpcc::SmartPointer
which confused me for a while, until I had a look at the implementation. While it might not have been the case in 2009, currently a smart pointer is a pretty specific concept used in the c++ standard library.I just assumed, that a
xpcc::SmartPointer
would act the same as thestd::shared_ptr
which it does not. I figured that out after searching for the point at which memory to be managed by thexpcc::SmartPointer
was allocated. This point does not exist, as thexpcc::SmartPointer
exclusively manages a runtime sizeduint8_t
array which it allocates internally.Thus it makes sense to keep the
xpcc::SmartPointer
implementation in thecontainer
directory.The naming however is imho very misleading.
I therefore propose the rename
xpcc::SmartPointer
. I haven't come up with a good enough name yet, but some possibilities are:xpcc::SharedMemory
xpcc::ManagedMemory
xpcc::ManagedSharedMemory
Does anyone have a better suggestion, or does anyone oppose a name change?
The text was updated successfully, but these errors were encountered: