From: Adam Dickmeiss Date: Thu, 26 Mar 2009 13:30:30 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yazpp X-Git-Tag: v1.1.2~2 X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=commitdiff_plain;h=5572939808550f720b9c246befcdef19955ff067;hp=100c063b92efad190f49054d09cad7b8eb3bf0ca Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yazpp --- diff --git a/configure.ac b/configure.ac index 0ee2b8a..f4e73d8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl YAZ++ Toolkit Index Data 1998-2008 dnl See the file LICENSE for details. AC_PREREQ(2.60) -AC_INIT([yazpp],[1.1.1],[adam@indexdata.dk]) +AC_INIT([yazpp],[1.1.2],[adam@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([1.9]) @@ -12,7 +12,7 @@ AC_PROG_CXX AC_HEADER_STDC AM_PROG_LIBTOOL -YAZ_INIT([threads],[3.0.30]) +YAZ_INIT([threads],[3.0.45]) if test -z "$YAZLIB"; then AC_MSG_ERROR([YAZ development libraries missing]) fi diff --git a/src/yaz-z-cache.cpp b/src/yaz-z-cache.cpp index 9c3eab6..5277a0d 100644 --- a/src/yaz-z-cache.cpp +++ b/src/yaz-z-cache.cpp @@ -5,6 +5,7 @@ #include #include +#include #include using namespace yazpp_1; @@ -84,6 +85,7 @@ void RecordCache::copy_presentRequest(Z_PresentRequest *pr) odr_destroy(decode); } + void RecordCache::add (ODR o, Z_NamePlusRecordList *npr, int start, int hits) { @@ -106,23 +108,14 @@ void RecordCache::add (ODR o, Z_NamePlusRecordList *npr, int start, comp->u.simple = esn; } - // Z_NamePlusRecordList *npr to be owned by m_mem.. - NMEM tmp_mem = odr_extract_mem(o); - nmem_transfer(m_mem, tmp_mem); - nmem_destroy(tmp_mem); - // Insert individual records in cache int i; for (i = 0; inum_records; i++) { RecordCache_Entry *entry = (RecordCache_Entry *) nmem_malloc(m_mem, sizeof(*entry)); - entry->m_record = (Z_NamePlusRecord *) - nmem_malloc(m_mem, sizeof(*entry->m_record)); - entry->m_record->databaseName = npr->records[i]->databaseName; - entry->m_record->which = npr->records[i]->which; - entry->m_record->u.databaseRecord = npr->records[i]->u.databaseRecord; - entry->m_comp = comp; + entry->m_record = yaz_clone_z_NamePlusRecord(npr->records[i], m_mem); + entry->m_comp = yaz_clone_z_RecordComposition(comp, m_mem); entry->m_offset = i + start; entry->m_next = m_entries; m_entries = entry;