inmemory_kv 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/inmemory_kv.c +9 -6
- data/lib/inmemory_kv/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffaeeb79dd57e1fc012e9b238ed9a519100ebc71
|
4
|
+
data.tar.gz: 50294e8cf9bbcc2a9b77438bf1b2b0c801c713f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654cc28b96bf064a196bcfd919101a0a4e539957d6ea075f318f973ecb21a65b71a0bf14b400dfdcf2b7e503b8582cc0e43da60ada4506d7fc711bc6c68839ed
|
7
|
+
data.tar.gz: a257f796ceafbcc2f9c9a5a076047a7286a6fce77f96777da953bd5f6ddd42242c3108b2280942774f27e34620bd88c816bc1d282db38e7e033569cf3bcd7889
|
data/ext/inmemory_kv.c
CHANGED
@@ -402,16 +402,19 @@ kv_insert(inmemory_kv *kv, const char* key, u32 key_size, const char* val, u32 v
|
|
402
402
|
}
|
403
403
|
if (item == NULL) {
|
404
404
|
u32 new_size = item_need_size(key_size, val_size);
|
405
|
-
#
|
405
|
+
#ifndef HAVE_MALLOC_USABLE_SIZE
|
406
|
+
new_size = (new_size + 7) & 7;
|
407
|
+
#endif
|
406
408
|
item = malloc(new_size);
|
407
|
-
if (item == NULL)
|
409
|
+
if (item == NULL) {
|
410
|
+
if (old_item == NULL) {
|
411
|
+
hash_delete(&kv->tab, pos);
|
412
|
+
}
|
408
413
|
return NULL;
|
414
|
+
}
|
415
|
+
#ifdef HAVE_MALLOC_USABLE_SIZE
|
409
416
|
new_size = malloc_usable_size(item);
|
410
417
|
#else
|
411
|
-
new_size = (new_size + 7) & 7;
|
412
|
-
item = malloc(new_size);
|
413
|
-
if (item == NULL)
|
414
|
-
return NULL;
|
415
418
|
item->item_size = new_size;
|
416
419
|
#endif
|
417
420
|
if (old_item != NULL) {
|
data/lib/inmemory_kv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inmemory_kv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sokolov Yura aka funny_falcon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,10 +93,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.4.
|
96
|
+
rubygems_version: 2.4.3
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Simple in memory string/string hash without GC presure
|
100
100
|
test_files:
|
101
101
|
- test/test_str2str.rb
|
102
|
-
has_rdoc:
|