summaryrefslogtreecommitdiff
path: root/lib/idm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/idm.c')
-rw-r--r--lib/idm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/idm.c b/lib/idm.c
index 66e311c6..ac5ec571 100644
--- a/lib/idm.c
+++ b/lib/idm.c
@@ -22,6 +22,7 @@ idm_init(struct idm *m, pool *p, uint size)
m->used = 1;
m->size = size;
m->data = mb_allocz(p, m->size * sizeof(u32));
+ m->pool = p;
/* ID 0 is reserved */
m->data[0] = 1;
@@ -34,6 +35,8 @@ idm_alloc(struct idm *m)
{
uint i, j;
+ ASSERT_DIE(DG_IS_LOCKED(m->pool->domain));
+
for (i = m->pos; i < m->size; i++)
if (m->data[i] != 0xffffffff)
goto found;
@@ -67,6 +70,8 @@ found:
void
idm_free(struct idm *m, u32 id)
{
+ ASSERT_DIE(DG_IS_LOCKED(m->pool->domain));
+
uint i = id / 32;
uint j = id % 32;