more cache manager issues

Nigel Spon nigel at adi.co.nz
Tue Oct 31 20:21:37 UTC 2000


>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.

I dealt with this by having one heap and an allocator which could return 
aligned blocks by padding the front of the block and returning a pointer 
that was offset 1-3 longwords into the block as necessary. The free 
function then checks for the padding words, which are a value that can't 
appear in a block header. This allows it to locate the real block header 
and free that. 

Not terribly elegant, but it works and has one heap and one free...




More information about the users mailing list