From ed8cd9432d6200bbd8e4f833fcd7b18e9f2af18c Mon Sep 17 00:00:00 2001 From: David Lovemore Date: Thu, 30 Aug 2012 13:48:41 +0100 Subject: In tracescanareatagged use the alignments of pools in the condemned set to determine mask. Copied from Perforce Change: 179117 ServerID: perforce.ravenbrook.com --- mps/code/mpm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mps/code/mpm.c') diff --git a/mps/code/mpm.c b/mps/code/mpm.c index 4f9af3f888c..71b93d8a41d 100644 --- a/mps/code/mpm.c +++ b/mps/code/mpm.c @@ -174,7 +174,14 @@ Word (WordAlignDown)(Word word, Align alignment) Bool SizeIsP2(Size size) { - return size > 0 && (size & (size - 1)) == 0; + return WordIsP2((Word)size); +} + +/* WordIsP2 -- tests whether a word is a power of two */ + +Bool WordIsP2(Word word) +{ + return word > 0 && (word & (word - 1)) == 0; } -- cgit v1.2.1