more cache manager issues

Eric Norum eric at cls.usask.ca
Tue Oct 31 20:54:08 UTC 2000


Till Straumann wrote:

> An alternative to this approach would be letting
> rtems_cache_aligned_malloc()
> using its own heap with a bigger (cache aligned) granularity.

Yes, but now there's another configuration parameter to be dealt with. 
Deciding on where to split the heaps adds more of a burden to the
application programmer.

> 
> One global `free(arg)' function could then determine the heap
> corresponding to the argument
> by comparing the argument pointer to the standard heap / aligned heap
> starting and end addresses.
> 
> Even more elegant would of course be an object oriented approach with a
> virtual `free' member
> function (or a field in the block header holding the information about
> which version of `free' must
> be used for that specific block of memory).

Yep.  Maybe the memory allocation routines (both regular and cache
aligned) should be rewritten to do this.  
> 
> IMHO, the need to call a `special' deallocator function is very error
> prone.

Agreed.
My quick solution to the problem wasn't very good.

I'm not yet convinced that dual heaps is a good idea, though.

-- 
Eric Norum                                 eric at cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.



More information about the users mailing list