Dynamic memory allocation approaches for C++ apps - pros and cons

Angelo Fraietta newsgroups at smartcontroller.com.au
Mon Dec 3 20:35:09 UTC 2007



Robert S. Grimes wrote:
> Might I ask what you based your allocator on?  Did you use a chunk of 
> memory from the heap, and manage that yourself?  Or did you use RTEMS 
> Regions or Partitions?  I'm particularly interested in the "quality" of 
> those subsystems.

I created a linked list for each class and allocated will malloc when i 
needed it - the size of the required memory is passed in operator new of 
the class. Instead of freeing the memory when I released in my app via 
'delete' , I put it aside and cached for use in the next allocation via 
'new'
-- 
Dr Angelo Fraietta
A.Eng, A.Mus.A, BA(Hons), Ph.D.

PO Box 859
Hamilton NSW 2303

Home Page


http://www.smartcontroller.com.au/

There are those who seek knowledge for the sake of knowledge - that is 
CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
     Bernard of Clairvaux (1090 - 1153)




More information about the users mailing list