diff options
Diffstat (limited to 'mps/code/pool.c')
| -rw-r--r-- | mps/code/pool.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mps/code/pool.c b/mps/code/pool.c index 0257359e36f..fc04563175b 100644 --- a/mps/code/pool.c +++ b/mps/code/pool.c | |||
| @@ -303,16 +303,20 @@ Size PoolFreeSize(Pool pool) | |||
| 303 | return Method(Pool, pool, freeSize)(pool); | 303 | return Method(Pool, pool, freeSize)(pool); |
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | /* PoolAddrObject -- return base pointer from interior pointer */ | 306 | |
| 307 | Res PoolAddrObject(Addr *pReturn, Pool pool, Seg seg, Addr addr) | 307 | /* PoolAddrObject -- return base pointer from interior pointer |
| 308 | * | ||
| 309 | * Note: addr is not necessarily inside the pool, even though | ||
| 310 | * mps_addr_object dispatches via the tract table. This allows this | ||
| 311 | * function to be used more generally internally. The pool should | ||
| 312 | * check (it has to anyway). | ||
| 313 | */ | ||
| 314 | |||
| 315 | Res PoolAddrObject(Addr *pReturn, Pool pool, Addr addr) | ||
| 308 | { | 316 | { |
| 309 | AVER(pReturn != NULL); | 317 | AVER(pReturn != NULL); |
| 310 | AVERT(Pool, pool); | 318 | AVERT(Pool, pool); |
| 311 | AVERT(Seg, seg); | 319 | return Method(Pool, pool, addrObject)(pReturn, pool, addr); |
| 312 | AVER(pool == SegPool(seg)); | ||
| 313 | AVER(SegBase(seg) <= addr); | ||
| 314 | AVER(addr < SegLimit(seg)); | ||
| 315 | return Method(Pool, pool, addrObject)(pReturn, pool, seg, addr); | ||
| 316 | } | 320 | } |
| 317 | 321 | ||
| 318 | /* PoolDescribe -- describe a pool */ | 322 | /* PoolDescribe -- describe a pool */ |