projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
align block sizes for isam sys. Better plot for test
[idzebra-moved-to-github.git]
/
isamb
/
isamb.c
diff --git
a/isamb/isamb.c
b/isamb/isamb.c
index
c9def6a
..
343e5e3
100644
(file)
--- a/
isamb/isamb.c
+++ b/
isamb/isamb.c
@@
-2,7
+2,7
@@
* Copyright (c) 2000-2002, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 2000-2002, Index Data.
* See the file LICENSE for details.
*
- * $Id: isamb.c,v 1.15 2002-05-14 21:12:56 adam Exp $
+ * $Id: isamb.c,v 1.17 2002-06-19 10:29:17 adam Exp $
*/
#include <yaz/xmalloc.h>
#include <yaz/log.h>
*/
#include <yaz/xmalloc.h>
#include <yaz/log.h>
@@
-74,12
+74,12
@@
void decode_ptr (char **src, int *pos)
ISAMB isamb_open (BFiles bfs, const char *name, int writeflag, ISAMC_M method)
{
ISAMB isamb = xmalloc (sizeof(*isamb));
ISAMB isamb_open (BFiles bfs, const char *name, int writeflag, ISAMC_M method)
{
ISAMB isamb = xmalloc (sizeof(*isamb));
- int i, b_size = 64;
+ int i, b_size = 32;
isamb->bfs = bfs;
isamb->method = (ISAMC_M) xmalloc (sizeof(*method));
memcpy (isamb->method, method, sizeof(*method));
isamb->bfs = bfs;
isamb->method = (ISAMC_M) xmalloc (sizeof(*method));
memcpy (isamb->method, method, sizeof(*method));
- isamb->no_cat = 3;
+ isamb->no_cat = 4;
isamb->file = xmalloc (sizeof(*isamb->file) * isamb->no_cat);
for (i = 0; i<isamb->no_cat; i++)
isamb->file = xmalloc (sizeof(*isamb->file) * isamb->no_cat);
for (i = 0; i<isamb->no_cat; i++)
@@
-203,7
+203,7
@@
int insert_sub (ISAMB b, struct ISAMB_block **p,
int insert_int (ISAMB b, struct ISAMB_block *p, void *lookahead_item,
int *mode,
ISAMC_I stream, struct ISAMB_block **sp,
int insert_int (ISAMB b, struct ISAMB_block *p, void *lookahead_item,
int *mode,
ISAMC_I stream, struct ISAMB_block **sp,
- void *split_item, int *split_size)
+ void *split_item, int *split_size, void *last_max_item)
{
char *startp = p->bytes;
char *src = startp;
{
char *startp = p->bytes;
char *src = startp;
@@
-240,7
+240,7
@@
int insert_int (ISAMB b, struct ISAMB_block *p, void *lookahead_item,
sub_p1 = open_block (b, pos);
assert (sub_p1);
more = insert_sub (b, &sub_p1, lookahead_item, mode, stream, &sub_p2,
sub_p1 = open_block (b, pos);
assert (sub_p1);
more = insert_sub (b, &sub_p1, lookahead_item, mode, stream, &sub_p2,
- sub_item, &sub_size, 0);
+ sub_item, &sub_size, last_max_item);
}
if (sub_p2)
{
}
if (sub_p2)
{
@@
-389,7
+389,7
@@
int insert_leaf (ISAMB b, struct ISAMB_block **sp1, void *lookahead_item,
if (lookahead_item && max_item &&
(*b->method->compare_item)(max_item, lookahead_item) <= 0)
{
if (lookahead_item && max_item &&
(*b->method->compare_item)(max_item, lookahead_item) <= 0)
{
- yaz_log (LOG_LOG, "max_item 1");
+ /* max_item 1 */
lookahead_item = 0;
}
lookahead_item = 0;
}
@@
-428,7
+428,7
@@
int insert_leaf (ISAMB b, struct ISAMB_block **sp1, void *lookahead_item,
if (max_item &&
(*b->method->compare_item)(max_item, lookahead_item) <= 0)
{
if (max_item &&
(*b->method->compare_item)(max_item, lookahead_item) <= 0)
{
- yaz_log (LOG_LOG, "max_item 2");
+ /* max_item 2 */
break;
}
if (!*lookahead_mode)
break;
}
if (!*lookahead_mode)
@@
-537,7
+537,7
@@
int insert_sub (ISAMB b, struct ISAMB_block **p, void *new_item,
sub_size, max_item);
else
return insert_int (b, *p, new_item, mode, stream, sp, sub_item,
sub_size, max_item);
else
return insert_int (b, *p, new_item, mode, stream, sp, sub_item,
- sub_size);
+ sub_size, max_item);
}
int isamb_merge (ISAMB b, ISAMC_P pos, ISAMC_I stream)
}
int isamb_merge (ISAMB b, ISAMC_P pos, ISAMC_I stream)