-/* $Id: isamb.c,v 1.62 2004-12-13 20:51:31 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
+/* $Id: isamb.c,v 1.65 2005-01-03 11:02:42 adam Exp $
+ Copyright (C) 1995-2005
Index Data Aps
This file is part of the Zebra server.
isamb->file[i].head.first_block = ISAMB_CACHE_ENTRY_SIZE/b_size+1;
isamb->file[i].head.last_block = isamb->file[i].head.first_block;
isamb->file[i].head.block_size = b_size;
+#if ISAMB_PTR_CODEC
if (i == isamb->no_cat-1 || b_size > 128)
isamb->file[i].head.block_offset = 8;
else
isamb->file[i].head.block_offset = 4;
+#else
+ isamb->file[i].head.block_offset = 11;
+#endif
isamb->file[i].head.block_max =
b_size - isamb->file[i].head.block_offset;
isamb->file[i].head.free_list = 0;
}
yaz_log (b->log_freelist, "got block " ZINT_FORMAT " from freelist %d:" ZINT_FORMAT, p->pos,
cat, p->pos/CAT_MAX);
- memcpy (&b->file[cat].head.free_list, p->buf, sizeof(int));
+ memcpy (&b->file[cat].head.free_list, p->buf, sizeof(zint));
}
p->cat = cat;
b->file[cat].head_dirty = 1;
{
yaz_log (b->log_freelist, "release block " ZINT_FORMAT " from freelist %d:" ZINT_FORMAT,
p->pos, p->cat, p->pos/CAT_MAX);
- memcpy (p->buf, &b->file[p->cat].head.free_list, sizeof(int));
+ memcpy (p->buf, &b->file[p->cat].head.free_list, sizeof(zint));
b->file[p->cat].head.free_list = p->pos;
if (!get_block (b, p->pos, p->buf, 1))
{
char *dst = p2->bytes + p2->size;
encode_ptr (&dst, p->pos);
- assert (sub_size < 40);
+ assert (sub_size < 80 && sub_size > 1);
encode_ptr (&dst, sub_size);
memcpy (dst, sub_item, sub_size);
dst += sub_size;
ISAMB_PP pp = xmalloc (sizeof(*pp));
int i;
+ assert(pos);
+
pp->isamb = isamb;
pp->block = xmalloc (ISAMB_MAX_LEVEL * sizeof(*pp->block));
pp->no_blocks++;
if (p->leaf)
break;
-
-
decode_ptr (&src, &pos);
p->offset = src - p->bytes;
pp->level++;