Skip to content

Commit

Permalink
sync with tokyotyrant-1.4.29.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
clement committed Jul 6, 2009
1 parent 7581b07 commit 02992e5
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 44 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
@@ -1,3 +1,9 @@
2009-07-03 Mikio Hirabayashi <mikio@users.sourceforge.net>

* tctdb.c (tctdbidxgetbyftsunion): efficiency couting sort was improved.

- Release: 1.4.29

2009-06-22 Mikio Hirabayashi <mikio@users.sourceforge.net>

* tcutil.c (tcstrutfnorm, tcstrkwic, tcstrtokenize): new functions.
Expand Down
20 changes: 10 additions & 10 deletions configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for tokyocabinet 1.4.28.
# Generated by GNU Autoconf 2.63 for tokyocabinet 1.4.29.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Expand Down Expand Up @@ -594,8 +594,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tokyocabinet'
PACKAGE_TARNAME='tokyocabinet'
PACKAGE_VERSION='1.4.28'
PACKAGE_STRING='tokyocabinet 1.4.28'
PACKAGE_VERSION='1.4.29'
PACKAGE_STRING='tokyocabinet 1.4.29'
PACKAGE_BUGREPORT=''

# Factoring default headers for most tests.
Expand Down Expand Up @@ -1283,7 +1283,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures tokyocabinet 1.4.28 to adapt to many kinds of systems.
\`configure' configures tokyocabinet 1.4.29 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1344,7 +1344,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of tokyocabinet 1.4.28:";;
short | recursive ) echo "Configuration of tokyocabinet 1.4.29:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1448,7 +1448,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
tokyocabinet configure 1.4.28
tokyocabinet configure 1.4.29
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
Expand All @@ -1462,7 +1462,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by tokyocabinet $as_me 1.4.28, which was
It was created by tokyocabinet $as_me 1.4.29, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -1833,7 +1833,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Package information
MYLIBVER=8
MYLIBREV=19
MYLIBREV=20
MYFORMATVER="1.0"
# Targets
Expand Down Expand Up @@ -6719,7 +6719,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tokyocabinet $as_me 1.4.28, which was
This file was extended by tokyocabinet $as_me 1.4.29, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -6769,7 +6769,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
tokyocabinet config.status 1.4.28
tokyocabinet config.status 1.4.29
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Expand Up @@ -7,11 +7,11 @@
#================================================================

# Package name
AC_INIT(tokyocabinet, 1.4.28)
AC_INIT(tokyocabinet, 1.4.29)

# Package information
MYLIBVER=8
MYLIBREV=19
MYLIBREV=20
MYFORMATVER="1.0"

# Targets
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html
Expand Up @@ -126,7 +126,7 @@ <h2 id="packages">Packages</h2>
<p>The following are the source packages of Tokyo Cabinet. As for binary packages, see the site of each distributor.</p>

<ul>
<li><a href="tokyocabinet-1.4.28.tar.gz">Latest Source Package (version 1.4.28)</a></li>
<li><a href="tokyocabinet-1.4.29.tar.gz">Latest Source Package (version 1.4.29)</a></li>
<li><a href="pastpkg/">Past Versions</a></li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion doc/index.ja.html
Expand Up @@ -167,7 +167,7 @@ <h2 id="packages">ダウンロード</h2>
<p>以下のソースパッケージをダウンロードしてください。バイナリパッケージについては、各ディストリビュータのサイトをご覧ください。</p>

<ul>
<li><a href="tokyocabinet-1.4.28.tar.gz">最新のソースパッケージ(バージョン1.4.28</a></li>
<li><a href="tokyocabinet-1.4.29.tar.gz">最新のソースパッケージ(バージョン1.4.29</a></li>
<li><a href="pastpkg/">過去のバージョン</a></li>
</ul>

Expand Down
61 changes: 33 additions & 28 deletions tctdb.c
Expand Up @@ -5235,14 +5235,18 @@ static void tctdbidxgetbyftsunion(TDBIDX *idx, const TCLIST *tokens, bool sign,
TCMALLOC(socrs, TDBFTSOCRUNIT * sizeof(*socrs));
int sonum = 0;
int soanum = TDBFTSOCRUNIT;
int sobase = 0;
TDBFTSNUMOCR *nocrs;
TCMALLOC(nocrs, TDBFTSOCRUNIT * sizeof(*nocrs));
int nonum = 0;
int noanum = TDBFTSOCRUNIT;
int nobase = 0;
TCBITMAP *pkmap = TCBITMAPNEW(TDBFTSBMNUM);
char token[TDBIDXQGUNIT*3+1];
uint16_t seq = 0;
for(int j = 0; j < anum; j += TDBIDXQGUNIT){
sobase = sonum;
nobase = nonum;
int diff = anum - j - TDBIDXQGUNIT;
if(diff < 0){
j += diff;
Expand Down Expand Up @@ -5388,38 +5392,40 @@ static void tctdbidxgetbyftsunion(TDBIDX *idx, const TCLIST *tokens, bool sign,
}
}
seq++;
if(sonum <= sobase && nonum <= nobase){
sonum = 0;
nonum = 0;
break;
}
}
TCBITMAPDEL(pkmap);
if(seq > 1){
if(sonum > UINT16_MAX){
int flnum = sonum * 16 + 1;
TCBITMAP *flmap = TCBITMAPNEW(flnum);
int tseq = seq - 1;
for(int j = 0; j < sonum; j++){
for(int j = sobase; j < sonum; j++){
TDBFTSSTROCR *ocr = socrs + j;
if(ocr->seq < tseq) continue;
uint32_t hash = (((uint32_t)socrs[j].off << 16) | socrs[j].hash) % flnum;
uint32_t hash = (((uint32_t)ocr->off << 16) | ocr->hash) % flnum;
TCBITMAPON(flmap, hash);
}
int wi = 0;
for(int j = 0; j < sonum; j++){
for(int j = 0; j < sobase; j++){
TDBFTSSTROCR *ocr = socrs + j;
if(ocr->seq < tseq){
int rem = (seq - ocr->seq - 1) * TDBIDXQGUNIT;
uint32_t hash = (((uint32_t)(socrs[j].off + rem) << 16) | socrs[j].hash) % flnum;
if(TCBITMAPCHECK(flmap, hash)) socrs[wi++] = *ocr;
} else {
socrs[wi++] = *ocr;
}
int rem = (seq - ocr->seq - 1) * TDBIDXQGUNIT;
uint32_t hash = (((uint32_t)(ocr->off + rem) << 16) | ocr->hash) % flnum;
if(TCBITMAPCHECK(flmap, hash)) socrs[wi++] = *ocr;
}
for(int j = sobase; j < sonum; j++){
socrs[wi++] = socrs[j];
}
sonum = wi;
TCBITMAPDEL(flmap);
}
if(sonum > UINT16_MAX * 2){
TDBFTSSTROCR *rocrs;
TCMALLOC(rocrs, sizeof(*rocrs) * sonum);
uint32_t counts[UINT16_MAX+1];
memset(counts, 0, sizeof(counts));
uint32_t *counts;
TCCALLOC(counts, sizeof(*counts), (UINT16_MAX + 1));
for(int j = 0; j < sonum; j++){
counts[socrs[j].hash]++;
}
Expand All @@ -5437,6 +5443,7 @@ static void tctdbidxgetbyftsunion(TDBIDX *idx, const TCLIST *tokens, bool sign,
int num = sonum - counts[UINT16_MAX];
if(num > 1) qsort(rocrs + counts[UINT16_MAX], num, sizeof(*rocrs),
(int (*)(const void *, const void *))tctdbidxftscmpstrocr);
TCFREE(counts);
TCFREE(socrs);
socrs = rocrs;
} else if(sonum > 1){
Expand All @@ -5446,32 +5453,29 @@ static void tctdbidxgetbyftsunion(TDBIDX *idx, const TCLIST *tokens, bool sign,
if(nonum > UINT16_MAX){
int flnum = nonum * 16 + 1;
TCBITMAP *flmap = TCBITMAPNEW(flnum);
int tseq = seq - 1;
for(int j = 0; j < nonum; j++){
for(int j = nobase; j < nonum; j++){
TDBFTSNUMOCR *ocr = nocrs + j;
if(ocr->seq < tseq) continue;
uint32_t hash = (((uint32_t)nocrs[j].off << 16) | nocrs[j].hash) % flnum;
uint32_t hash = (((uint32_t)ocr->off << 16) | ocr->hash) % flnum;
TCBITMAPON(flmap, hash);
}
int wi = 0;
for(int j = 0; j < nonum; j++){
for(int j = 0; j < nobase; j++){
TDBFTSNUMOCR *ocr = nocrs + j;
if(ocr->seq < tseq){
int rem = (seq - ocr->seq - 1) * TDBIDXQGUNIT;
uint32_t hash = (((uint32_t)(nocrs[j].off + rem) << 16) | nocrs[j].hash) % flnum;
if(TCBITMAPCHECK(flmap, hash)) nocrs[wi++] = *ocr;
} else {
nocrs[wi++] = *ocr;
}
int rem = (seq - ocr->seq - 1) * TDBIDXQGUNIT;
uint32_t hash = (((uint32_t)(ocr->off + rem) << 16) | ocr->hash) % flnum;
if(TCBITMAPCHECK(flmap, hash)) nocrs[wi++] = *ocr;
}
for(int j = nobase; j < nonum; j++){
nocrs[wi++] = nocrs[j];
}
nonum = wi;
TCBITMAPDEL(flmap);
}
if(nonum > UINT16_MAX * 2){
TDBFTSNUMOCR *rocrs;
TCMALLOC(rocrs, sizeof(*rocrs) * nonum);
uint32_t counts[UINT16_MAX+1];
memset(counts, 0, sizeof(counts));
uint32_t *counts;
TCCALLOC(counts, sizeof(*counts), (UINT16_MAX + 1));
for(int j = 0; j < nonum; j++){
counts[nocrs[j].hash]++;
}
Expand All @@ -5489,6 +5493,7 @@ static void tctdbidxgetbyftsunion(TDBIDX *idx, const TCLIST *tokens, bool sign,
int num = nonum - counts[UINT16_MAX];
if(num > 1) qsort(rocrs + counts[UINT16_MAX], num, sizeof(*rocrs),
(int (*)(const void *, const void *))tctdbidxftscmpnumocr);
TCFREE(counts);
TCFREE(nocrs);
nocrs = rocrs;
} else if(nonum > 1){
Expand Down
4 changes: 2 additions & 2 deletions tcutil.h
Expand Up @@ -3634,8 +3634,8 @@ typedef unsigned char TCBITMAP; /* type of a bit map object */

#include <stdio.h>

#define _TC_VERSION "1.4.28"
#define _TC_LIBVER 819
#define _TC_VERSION "1.4.29"
#define _TC_LIBVER 820
#define _TC_FORMATVER "1.0"

enum { /* enumeration for error codes */
Expand Down

0 comments on commit 02992e5

Please sign in to comment.