void *
lp_alloc(linpool *m, uint size)
{
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&m->r)->domain));
byte *a = (byte *) BIRD_ALIGN((unsigned long) m->ptr, CPU_STRUCT_ALIGN);
byte *e = a + size;
void *
lp_allocu(linpool *m, uint size)
{
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&m->r)->domain));
byte *a = m->ptr;
byte *e = a + size;
void
lp_flush(linpool *m)
{
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&m->r)->domain));
struct lp_chunk *c;
/* Move ptr to the first chunk and free all other chunks */
void
lp_save(linpool *m, lp_state *p)
{
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&m->r)->domain));
p->current = m->current;
p->large = m->first_large;
p->total_large = m->total_large;
lp_restore(linpool *m, lp_state *p)
{
struct lp_chunk *c;
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&m->r)->domain));
/* Move ptr to the saved pos and free all newer large chunks */
m->current = c = p->current ?: m->first;
return q;
}
-static pool *
-resource_parent(resource *r)
-{
- return SKIP_BACK(pool, inside, resource_enlisted(r));
-}
-
-
/**
* rmove - move a resource
* @res: resource
extern pool root_pool;
+static inline pool *resource_parent(resource *r)
+{ return SKIP_BACK(pool, inside, resource_enlisted(r)); }
+
/* Normal memory blocks */
void *mb_alloc(pool *, unsigned size);
sl_alloc(slab *s)
{
struct sl_head *h;
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&s->r)->domain));
redo:
if (!(h = s->partial_heads.first))
{
struct sl_head *h = SL_GET_HEAD(oo);
struct slab *s = h->slab;
+ ASSERT_DIE(DG_IS_LOCKED(resource_parent(&s->r)->domain));
#ifdef POISON
memset(oo, 0xdb, s->data_size);