Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++ MemPool for real-time systems

12 views
Skip to first unread message

Ramine

unread,
Mar 13, 2017, 6:26:52 PM3/13/17
to
Hello,


C++ MemPool for real-time systems


Description:

Real-Time Memory Management

In C++, memory management is normally performed using new,delete etc.
The run-time system's heap offers great flexibility and efficiency, but
it cannot fulfil real-time requirements. The run-time requirements are
non-deterministic. In addition, they may require blocking task switches,
which makes them unusable for interrupt handlers.

MemPool uses templates and offers memory management with real-time
capabilities through Memory Pools. A Memory Pool is an isolated heap
with data buffers as objects of equal size. Any number of memory pools
can exist simultaneously. A pool is initialized once and allocated a
certain number of buffers as objects. Thereafter, buffers as objects can
be allocated and deallocated from the pool under real-time conditions.

How to use it?

The parameters of the constructor are:

The first parameter is the number of items and the second parameter is a
boolean parameter that will tell MemPool to grow or not, if it is set to
true it will grow, set it to false for real-time systems, if you don't
pass any parameter, the number of items will be set to 200 and the
MemPool will not grow and thus it will be set for real-time systems.

The New() method returns a reference to the object.

The Return() method returns the reference to the object to the stack.

Please look at the test.cpp example to learn how to use MemPool.


Language: GNU C++ and Visual C++ and C++Builder


You can download my MemPool for real-time systems from:

https://sites.google.com/site/aminer68/c-mempool-for-real-time-systems



Thank you,
Amine Mouay Ramdane.

Rick C. Hodgin

unread,
Mar 13, 2017, 7:30:16 PM3/13/17
to
Ramine,

Thank you for your sharing attitude with regards to your software
algorithms. It reveals much about your caring for other people.

Thank you,
Rick C. Hodgin
0 new messages