summaryrefslogtreecommitdiff
path: root/viengoos/object.c
diff options
context:
space:
mode:
authorneal <neal>2008-06-24 14:40:59 +0000
committerneal <neal>2008-06-24 14:40:59 +0000
commit0d99d4c662383e345a7eb4bf37918eb1c39b3bc1 (patch)
tree30f5218bc79a0321b4a703297b912a597f1a560f /viengoos/object.c
parent25e777a0e6657a7cb9b976c87191c7055e8a98df (diff)
2008-06-24 Neal H. Walfield <neal@gnu.org>
* viengoos.c (main): Move assert from here... * object.c (object_init): ... to here. Use build_asserts, not asserts to check object sizes.
Diffstat (limited to 'viengoos/object.c')
-rw-r--r--viengoos/object.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/viengoos/object.c b/viengoos/object.c
index b69c692..f5708f7 100644
--- a/viengoos/object.c
+++ b/viengoos/object.c
@@ -60,11 +60,12 @@ static struct hurd_ihash objects;
void
object_init (void)
{
- assertx (sizeof (struct folio) <= PAGESIZE, "%d", sizeof (struct folio));
- assertx (sizeof (struct activity) <= PAGESIZE,
- "%d", sizeof (struct activity));
- assertx (sizeof (struct object) <= PAGESIZE, "%d", sizeof (struct object));
- assertx (sizeof (struct thread) <= PAGESIZE, "%d", sizeof (struct thread));
+ build_assert (sizeof (struct folio) <= PAGESIZE);
+ build_assert (sizeof (struct activity) <= PAGESIZE);
+ build_assert (sizeof (struct object) <= PAGESIZE);
+ build_assert (sizeof (struct thread) <= PAGESIZE);
+ /* Assert that the size of a cap is a power of 2. */
+ build_assert ((sizeof (struct cap) & (sizeof (struct cap) - 1)) == 0);
/* Allocate object hash. */