isomorfeus-ferret 0.13.4 → 0.13.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19cfca9e5508c89a931678c23a5b0b32d8759d0d1839ac0ecf0b043d93cd1ddf
4
- data.tar.gz: 5999edb4c8ce46718264abdfac47cdd2bcc0f8e0ddf46a0af69bfba1ec024a1c
3
+ metadata.gz: 1f2a4a6ea097a25d4d32a958c730fffca81ded61133f37ef4c86ca5b78ecef77
4
+ data.tar.gz: 7be1f98b64559be5f02e39d7a74894476046fef3fdd46d1e69ee3079c74c9681
5
5
  SHA512:
6
- metadata.gz: e8ab5a9574a3b610b4d554a94ecbdf3252a77d7947f81fdd21bdd0c87ed6bd0940f4842091f0bec793b4e061fe218706d0e16ef64ab19d85ca48d825a1867beb
7
- data.tar.gz: 474d0d57a321f3eaf47e372f76c7102592b85c7d0bf2e8506e7e3baf6ad3cbba2b5628296b5a3cf50b9bdba3031a2712225234143343cb9dbf80bc3781d00faa
6
+ metadata.gz: d173777ee520433e8df0e1a07853f92b65aa350427668baea67a957a28a8cadc05790396d8d5167282c4c83fb1e874eec3316c226e8c961f9f3161f3bf3ecb79
7
+ data.tar.gz: c64a96813a4b2546e21825cb4a6310c9384a8090bafe51e9c65c49d8c2b8bc69ab3deed82780e6df09089b6a915d6b7e7418bcac30f3d9770c1358800aa2286d
@@ -117,13 +117,13 @@ static void bm_single_run(BenchMarkUnit *unit, BenchMarkTimes *bm_times)
117
117
  struct rusage ru_before, ru_after;
118
118
 
119
119
  if (gettimeofday(&tv_before, NULL) == -1)
120
- FRT_RAISE(FRT_UNSUPPORTED_ERROR, "gettimeofday failed\n");
120
+ rb_raise(rb_eRuntimeError, "gettimeofday failed\n");
121
121
  getrusage(RUSAGE_SELF, &ru_before);
122
122
 
123
123
  unit->run();
124
124
 
125
125
  if (gettimeofday(&tv_after, NULL) == -1)
126
- FRT_RAISE(FRT_UNSUPPORTED_ERROR, "gettimeofday failed\n");
126
+ rb_raise(rb_eRuntimeError, "gettimeofday failed\n");
127
127
  getrusage(RUSAGE_SELF, &ru_after);
128
128
 
129
129
  bm_times->rtime = TVAL_TO_SEC(tv_before, tv_after);
@@ -1271,11 +1271,11 @@ void frb_iw_free(void *p) {
1271
1271
 
1272
1272
  void frb_iw_mark(void *p) {
1273
1273
  FrtIndexWriter *iw = (FrtIndexWriter *)p;
1274
- if (iw->analyzer->ranalyzer)
1274
+ if (iw->analyzer && iw->analyzer->ranalyzer)
1275
1275
  rb_gc_mark(iw->analyzer->ranalyzer);
1276
- if (iw->store->rstore)
1276
+ if (iw->store && iw->store->rstore)
1277
1277
  rb_gc_mark(iw->store->rstore);
1278
- if (iw->fis->rfis)
1278
+ if (iw->fis && iw->fis->rfis)
1279
1279
  rb_gc_mark(iw->fis->rfis);
1280
1280
  }
1281
1281
 
@@ -19,7 +19,6 @@ const char *const ERROR_TYPES[] = {
19
19
  "Lock Error"
20
20
  };
21
21
 
22
- bool frt_x_do_logging = false;
23
22
  bool frt_x_abort_on_exception = true;
24
23
  bool frt_x_has_aborted = false;
25
24
  FILE *frt_x_exception_stream = NULL;
@@ -418,9 +418,7 @@ static void fs_close_lock_i(FrtLock *lock)
418
418
 
419
419
  static FrtHash *stores = NULL;
420
420
 
421
- #ifndef UNTHREADED
422
421
  static frt_mutex_t stores_mutex = FRT_MUTEX_INITIALIZER;
423
- #endif
424
422
 
425
423
  static void fs_close_i(FrtStore *store)
426
424
  {
@@ -266,13 +266,6 @@ extern FILE *frt_x_exception_stream;
266
266
  #define EXCEPTION 2
267
267
  #define EXCEPTION_STREAM (frt_x_exception_stream ? frt_x_exception_stream : stderr)
268
268
 
269
- #ifdef DEBUG
270
- extern bool frt_x_do_logging;
271
- #define xlog if (frt_x_do_logging) printf
272
- #else
273
- #define xlog()
274
- #endif
275
-
276
269
  extern void frt_init(int arc, const char *const argv[]);
277
270
  extern void frt_micro_sleep(const int micro_seconds);
278
271
 
@@ -43,7 +43,14 @@ void *frt_erealloc(void *ptr, size_t size)
43
43
  return p;
44
44
  }
45
45
 
46
- /* void micro_sleep(const int micro_seconds)
46
+
47
+ struct timeval rb_time_interval _((VALUE));
48
+
49
+ extern void frt_micro_sleep(const int micro_seconds) {
50
+ rb_thread_wait_for(rb_time_interval(rb_float_new((double)micro_seconds/1000000.0)));
51
+ }
52
+
53
+ /* void frt_micro_sleep(const int micro_seconds)
47
54
  {
48
55
  #if (defined POSH_OS_WIN32 || defined POSH_OS_WIN64) && !defined __MINGW32__
49
56
  Sleep(micro_seconds / 1000);
@@ -5,7 +5,7 @@
5
5
  #include "frt_global.h"
6
6
  #include "frt_hash.h"
7
7
  #include "frt_hashset.h"
8
- #include "frb_threading.h"
8
+ #include "frt_threading.h"
9
9
 
10
10
  #define FRT_LOCK_PREFIX "ferret-"
11
11
  #define FRT_LOCK_EXT ".lck"
@@ -4,8 +4,8 @@
4
4
  #include "frt_except.h"
5
5
  #include "frt_hash.h"
6
6
  #include "frt_hashset.h"
7
- #include "frb_threading.h"
8
- #include "frb_lang.h"
7
+ #include "frt_threading.h"
8
+ #include "ruby.h"
9
9
 
10
10
  /* IDs */
11
11
  ID id_new;
@@ -1,10 +1,9 @@
1
1
  #ifndef __FERRET_H_
2
2
  #define __FERRET_H_
3
- #include <ruby.h>
4
3
  #include "frt_global.h"
5
4
  #include "frt_hashset.h"
6
5
  #include "frt_document.h"
7
- #include "frb_lang.h"
6
+ #include <ruby.h>
8
7
 
9
8
  /* IDs */
10
9
  extern ID id_new;
@@ -175,7 +175,7 @@ TestSuite *ts_threading(TestSuite *suite)
175
175
 
176
176
  tst_run_test(suite, test_number_to_str, NULL);
177
177
  tst_run_test(suite, test_threading_test, index);
178
- // tst_run_test(suite, test_threading, index);
178
+ tst_run_test(suite, test_threading, index);
179
179
 
180
180
  frt_index_destroy(index);
181
181
 
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module Ferret
3
- VERSION = '0.13.4'
3
+ VERSION = '0.13.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-ferret
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.4
4
+ version: 0.13.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -167,12 +167,9 @@ files:
167
167
  - ext/isomorfeus_ferret_ext/fio_tmpfile.h
168
168
  - ext/isomorfeus_ferret_ext/frb_analysis.c
169
169
  - ext/isomorfeus_ferret_ext/frb_index.c
170
- - ext/isomorfeus_ferret_ext/frb_lang.c
171
- - ext/isomorfeus_ferret_ext/frb_lang.h
172
170
  - ext/isomorfeus_ferret_ext/frb_qparser.c
173
171
  - ext/isomorfeus_ferret_ext/frb_search.c
174
172
  - ext/isomorfeus_ferret_ext/frb_store.c
175
- - ext/isomorfeus_ferret_ext/frb_threading.h
176
173
  - ext/isomorfeus_ferret_ext/frb_utils.c
177
174
  - ext/isomorfeus_ferret_ext/frt_analysis.c
178
175
  - ext/isomorfeus_ferret_ext/frt_analysis.h
@@ -1,9 +0,0 @@
1
- #include "frt_except.h"
2
- #include "frb_lang.h"
3
-
4
- struct timeval rb_time_interval _((VALUE));
5
-
6
- extern void frt_micro_sleep(const int micro_seconds)
7
- {
8
- rb_thread_wait_for(rb_time_interval(rb_float_new((double)micro_seconds/1000000.0)));
9
- }
@@ -1,17 +0,0 @@
1
- #ifndef FRT_LANG_H
2
- #define FRT_LANG_H
3
-
4
- #define RUBY_BINDINGS 1
5
-
6
- #include <stdarg.h>
7
- #include <ruby.h>
8
-
9
- #undef close
10
- #undef rename
11
- #undef read
12
-
13
- #define frt_emalloc xmalloc
14
- #define frt_ecalloc(n) xcalloc(n, 1)
15
- #define frt_erealloc xrealloc
16
-
17
- #endif
@@ -1,29 +0,0 @@
1
- #ifndef FRT_THREADING_H
2
- #define FRT_THREADING_H
3
-
4
- #include "frt_hash.h"
5
- #define UNTHREADED 1
6
-
7
- typedef void * frt_mutex_t;
8
- typedef struct FrtHash *frt_thread_key_t;
9
- typedef int frt_thread_once_t;
10
- #define FRT_MUTEX_INITIALIZER NULL
11
- #define FRT_THREAD_ONCE_INIT 1;
12
- #define frt_mutex_init(a, b)
13
- #define frt_mutex_lock(a)
14
- #define frt_mutex_trylock(a)
15
- #define frt_mutex_unlock(a)
16
- #define frt_mutex_destroy(a)
17
- #define frt_thread_key_create(a, b) frb_thread_key_create(a, b)
18
- #define frt_thread_key_delete(a) frb_thread_key_delete(a)
19
- #define frt_thread_setspecific(a, b) frb_thread_setspecific(a, b)
20
- #define frt_thread_getspecific(a) frb_thread_getspecific(a)
21
- #define frt_thread_once(a, b) frb_thread_once(a, b)
22
-
23
- void frb_thread_once(int *once_control, void (*init_routine)(void));
24
- void frb_thread_key_create(frt_thread_key_t *key, frt_free_ft destroy);
25
- void frb_thread_key_delete(frt_thread_key_t key);
26
- void frb_thread_setspecific(frt_thread_key_t key, const void *pointer);
27
- void *frb_thread_getspecific(frt_thread_key_t key);
28
-
29
- #endif