{
bb_t bb;
struct lizard_buffer *lizard;
- struct mempool *mp;
};
struct buck2obj_buf *
-buck2obj_alloc(struct mempool *mp)
+buck2obj_alloc(void)
{
struct buck2obj_buf *buf = xmalloc(sizeof(struct buck2obj_buf));
bb_init(&buf->bb);
buf->lizard = lizard_alloc();
- buf->mp = mp;
return buf;
}
xfree(buf);
}
-void
-buck2obj_flush(struct buck2obj_buf *buf)
-{
- mp_flush(buf->mp);
-}
-
static inline byte *
decode_attributes(byte *ptr, byte *end, struct odes *o, uns can_overwrite)
{
}
struct odes *
-obj_read_bucket(struct buck2obj_buf *buf, uns buck_type, uns buck_len, struct fastbuf *body, uns *body_start)
+obj_read_bucket(struct buck2obj_buf *buf, struct mempool *pool, uns buck_type, uns buck_len, struct fastbuf *body, uns *body_start)
{
- struct odes *o = obj_new(buf->mp);
+ struct odes *o = obj_new(pool);
if (buck_type < BUCKET_TYPE_V33)
{
struct buck2obj_buf;
struct mempool;
-struct buck2obj_buf *buck2obj_alloc(struct mempool *mp);
+struct buck2obj_buf *buck2obj_alloc(void);
void buck2obj_free(struct buck2obj_buf *buf);
-void buck2obj_flush(struct buck2obj_buf *buf);
-struct odes *obj_read_bucket(struct buck2obj_buf *buf, uns buck_type, uns buck_len, struct fastbuf *body, uns *body_start);
+struct odes *obj_read_bucket(struct buck2obj_buf *buf, struct mempool *pool, uns buck_type, uns buck_len, struct fastbuf *body, uns *body_start);
/* If body_start != NULL, then only the header is parsed and *body_start is
* set to the position of the body. The fastbuf is never overwritten when
* parsing a header.
static void
dump_parsed_bucket(struct fastbuf *out, struct obuck_header *h, struct fastbuf *b)
{
- mp_flush(pool);
- struct odes *o = obj_read_bucket(buck_buf, h->type, h->length, b, NULL);
+ struct odes *o = obj_read_bucket(buck_buf, pool, h->type, h->length, b, NULL);
if (!o)
bprintf(out, "Cannot parse bucket %x of type %x and length %d: %m\n", h->oid, h->type, h->length);
else
if (!raw)
{
pool = mp_new(1<<14);
- buck_buf = buck2obj_alloc(pool);
+ buck_buf = buck2obj_alloc();
}
switch (op)
{