Skip to content

Commit

Permalink
more sintact error fiixing
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Jan 5, 2025
1 parent c6712d3 commit bbbb58e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions newton-4.00/applications/ndSandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ int main(int, char**)
//ndArray<ndInt32> triangles;
//ndTriangulatePolygon(points, 5, triangles);

ndSharedPtr<int> strong(new int);
ndWeakPtr<int> weak(strong);


ndDemoEntityManager demos;
demos.Run();
return 0;
Expand Down
20 changes: 10 additions & 10 deletions newton-4.00/sdk/dCore/ndSharedPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
template <typename T>
class ndSharedPtr
{
class ndRefCounter : public ndContainersFreeListAlloc<ndRefCounter>
{
public:
ndRefCounter();
void AddRef();
ndInt32 Release();
ndAtomic<ndInt32> m_weakRef;
ndAtomic<ndInt32> m_sharedRef;
};

public:
ndSharedPtr();
ndSharedPtr(T* const ptr);
Expand All @@ -34,16 +44,6 @@ class ndSharedPtr
ndInt32 GetRefCount() const;

protected:
class ndRefCounter: public ndContainersFreeListAlloc<ndRefCounter>
{
public:
ndRefCounter();
void AddRef();
ndInt32 Release();
ndAtomic<ndInt32> m_weakRef;
ndAtomic<ndInt32> m_sharedRef;
};

T* m_ptr;
ndRefCounter* m_references;
};
Expand Down

0 comments on commit bbbb58e

Please sign in to comment.