[Root Pointer] Deterministic C++ memory manager (update)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Root Pointer] Deterministic C++ memory manager (update)

Boost - Dev mailing list
Greetings,

I wanted to give an update to the community regarding the memory manager
I wrote called: Root Pointer.

I now have a working template to solve all memory leaks in C++ and C but
both requires some meta data generator. The code can be found here; it
is working but not polished:
https://github.com/philippeb8/root_ptr

In this code we can find:

   - node_ptr: main class of the smart pointer / memory manager.
   - root_ptr: generic derived class that includes an "iterator" and a
pointer to the name of the instance (for debugging purposes).

Also I commented some code that logs the exact location of the memory leak.

Furthermore I would like to bring some observations that I found in the
C and the C++ language:

   - Pointers and iterators are not the same; i.e. pointers should point
to allocated blocks only and shouldn't have arithmetic operators while
iterators shouldn't be used to deallocate anything.
   - C pointers can only point to dynamic arrays (size known at run-time).
   - C++ pointers can point to both inherited objects and static arrays
(size known at compile-time). This creates a problem (see attached:
array_inherited_pointer.cpp).
   - std::array<T> should have constructors with T objects that have no
default constructor.

Lastly, before I submit anything, I will have to propose a way to apply
a template function to all non-static member variables of a class. This
will require implicit meta data generation. This idea is not new as
other libraries such as Qt is based on meta data and they certainly
could make us of this. For the moment I have a parser that does the job
correctly by specializing a boost::proxy() template function but
eventually this will have to be integrated into the standards.

Hopefully this is an important milestone!


Regards,
Phil Bouchard
www.fornux.com


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

array_inherited_pointer.cpp (317 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Root Pointer] Deterministic C++ memory manager (update)

Boost - Dev mailing list
On Tue, Nov 14, 2017 at 9:40 PM, Phil Bouchard via Boost
<[hidden email]> wrote:
> Greetings,
>
> I wanted to give an update to the community regarding the memory manager I
> wrote called: Root Pointer.

Just to let you know, that I've seen your message. But, right now
library authors are in the middle of preparing to ship Boost 1.66.0
(it is currently in beta) so you might not see activity on this thread
until after the release. Hang in there!

Thanks

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [Root Pointer] Deterministic C++ memory manager (update)

Boost - Dev mailing list
On 11/18/2017 09:10 PM, Vinnie Falco via Boost wrote:

> On Tue, Nov 14, 2017 at 9:40 PM, Phil Bouchard via Boost
> <[hidden email]> wrote:
>> Greetings,
>>
>> I wanted to give an update to the community regarding the memory manager I
>> wrote called: Root Pointer.
>
> Just to let you know, that I've seen your message. But, right now
> library authors are in the middle of preparing to ship Boost 1.66.0
> (it is currently in beta) so you might not see activity on this thread
> until after the release. Hang in there!
>
> Thanks
That's fine; I'm discussing it with the ISO C++ committee and I wanted
to keep Boost in sync.

Like I was saying before I'll need to change the C++ standards before
its implementation can be part of the Boost library (reverse flow).

For the moment you are welcome to take a look at what my [commercial]
parser does when it converts a C app into C++ while injecting Root.Ptr.
You'll notice node_proxy needs to be instantiated at each new scope and
references to these proxies are passed to each function and base class.


Later,
-Phil


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

input2.c (2K) Download Attachment
input2.cpp (7K) Download Attachment