MPS issue job003510

Titlemps_free doesn't check all addresses in range
Assigned userGareth Rees
DescriptionYou can call mps_free on any range of addresses, and so long as the base of the range belongs to a pool, then MVT and MVFF will happily stuff the whole of the range into its free block manager, even if (say) the last byte of the range is not in the pool. This is unsatisfactory as it fails to detect erroneous sizes in calls to mps_free() in the client program.
AnalysisNeed to add a new function PoolOfRange which determines whether a contiguous range of addresses belongs to a single pool, and if so, which pool it is.

Naively this would be an O(n) operation as we have to check all tracts in the range. But perhaps we can avoid this by seeing if the base and limit lie in the same "run" of tracts? This would depend on the arena coalescing adjacent runs.
How foundinspection
Observed in1.111.0
Created byGareth Rees
Created on2013-06-06 16:49:33
Last modified byGareth Rees
Last modified on2013-06-07 13:20:20
History2013-06-06 GDR Created.


Change Effect Date User Description
182602 closed 2013-06-07 13:20:20 Gareth Rees Check that all addresses in the freed range belong to the pool, not just the base of the range.