From: Martin Mares Date: Wed, 22 Jan 2003 18:30:13 +0000 (+0000) Subject: Objects always live in somebody else's pool. X-Git-Tag: holmes-import~1297 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a6c4d0101fc28d46f0ebf2401ea4e187a7276077;p=libucw.git Objects always live in somebody else's pool. obj_free and odes->local_pool are gone. --- diff --git a/lib/lib.h b/lib/lib.h index 4cf7b06d..8f0b6f45 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -102,7 +102,7 @@ struct fastbuf; struct odes { /* Object description */ struct oattr *attrs; - struct mempool *pool, *local_pool; + struct mempool *pool; struct oattr *cached_attr; }; @@ -114,7 +114,6 @@ struct oattr { /* Object attribute */ void obj_dump(struct odes *); struct odes *obj_new(struct mempool *); -void obj_free(struct odes *); int obj_read(struct fastbuf *, struct odes *); void obj_write(struct fastbuf *, struct odes *); struct oattr *obj_find_attr(struct odes *, uns); diff --git a/lib/object.c b/lib/object.c index dd7b43cf..daa5c973 100644 --- a/lib/object.c +++ b/lib/object.c @@ -40,26 +40,15 @@ oa_new(struct odes *o, uns x, byte *v) struct odes * obj_new(struct mempool *pool) { - struct mempool *lp = pool; struct odes *o; - if (!lp) - lp = mp_new(OBJ_POOL_SIZE); o = mp_alloc(lp, sizeof(struct odes)); - o->pool = lp; - o->local_pool = (pool == lp) ? NULL : lp; + o->pool = pool; o->attrs = NULL; o->cached_attr = NULL; return o; } -void -obj_free(struct odes *o) -{ - if (o->local_pool) - mp_delete(o->local_pool); -} - int obj_read(struct fastbuf *f, struct odes *o) {