Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
fchn289 committed Jun 24, 2024
1 parent edec0ea commit 425ee04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/domino/HdlrDomino.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#include "MsgSelf.hpp"
#include "ObjAnywhere.hpp"
#include "SafePtr.hpp"
#include "UniLog.hpp"
#include "UniPtr.hpp"

namespace RLib
{
Expand Down
2 changes: 1 addition & 1 deletion src/obj_anywhere/ObjAnywhere.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ObjAnywhere

private:
// -------------------------------------------------------------------------------------------
static shared_ptr<DataStore<ObjName>> name_obj_S_; // store aObj w/o include aObj.hpp
static shared_ptr<DataStore<ObjName>> name_obj_S_; // store aObj w/o include aObj.hpp; shared_ptr is safe here
};

// ***********************************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/safe_mem/SafePtr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SafePtr
// - safe-only creation, eg can't construct by raw ptr/shared_ptr that maybe unsafe
// - can't create by SafePtr(ConstructArgs...) that confuse cp constructor, make_safe() instead
// - T(ConstructArgs) SHALL mem-safe
SafePtr(nullptr_t = nullptr) noexcept {}
constexpr SafePtr(nullptr_t = nullptr) noexcept {}
template<typename U, typename... ConstructArgs> friend SafePtr<U> make_safe(ConstructArgs&&... aArgs);

// safe-only cast (vs shared_ptr, eg static_pointer_cast<any> is not safe)
Expand Down
5 changes: 3 additions & 2 deletions src/thread/MtInQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ using namespace std;

namespace RLib
{
// ele & its typeid.hash_code
using ELE_TID = pair<UniPtr, type_index>; // type_index ==/!= ok, but type_info* & hash_code nok
// - ele & its type_index(==/!= ok, but type_info* & hash_code nok)
// - shared_ptr is safe to cast void since type_index (but not safe as SafePtr's create)
using ELE_TID = pair<UniPtr, type_index>;
using EleHdlr = function<void(UniPtr)>;

// ***********************************************************************************************
Expand Down

0 comments on commit 425ee04

Please sign in to comment.