]> mj.ucw.cz Git - libucw.git/commitdiff
Objects always live in somebody else's pool.
authorMartin Mares <mj@ucw.cz>
Wed, 22 Jan 2003 18:30:13 +0000 (18:30 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 22 Jan 2003 18:30:13 +0000 (18:30 +0000)
obj_free and odes->local_pool are gone.

lib/lib.h
lib/object.c

index 4cf7b06d5460b81ab623c46ee22fe05b33ccef39..8f0b6f45474d612c1f012b5665ca4a80cc61099a 100644 (file)
--- 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);
index dd7b43cf368f3ba45093d22cf45e8256bf771f15..daa5c9736c4d3513bf02ade21d248b96323c81f8 100644 (file)
@@ -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)
 {