aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/pool.c
diff options
context:
space:
mode:
authorRichard Brooksby2023-06-07 14:57:55 +0100
committerRichard Brooksby2023-06-07 14:57:55 +0100
commitd137edaaa51c767c7d1d3af4b648253ad7092d13 (patch)
treec36d0808357ac471782764974f3f9415ef9ef6bd /mps/code/pool.c
parent13d10c5989d0d1ad0437b44306e5e8418bbe8b91 (diff)
downloademacs-d137edaaa51c767c7d1d3af4b648253ad7092d13.tar.gz
emacs-d137edaaa51c767c7d1d3af4b648253ad7092d13.zip
Generalising mps_addr_object, arenaaddrobject, pooladdrobject for pools that do not use segments.
Diffstat (limited to 'mps/code/pool.c')
-rw-r--r--mps/code/pool.c18
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
307Res 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
315Res 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 */