google_hash 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/changelog +3 -0
- data/ext/extconf.rb +8 -0
- data/ext/template/google_hash.cpp.erb +14 -6
- data/google_hash.gemspec +142 -0
- metadata +3 -2
data/README
CHANGED
@@ -86,7 +86,7 @@ c = GoogleHashSparseIntToInt.new # :int => :int
|
|
86
86
|
|
87
87
|
Here's the full list of availables:
|
88
88
|
|
89
|
-
>> Object.constants.
|
89
|
+
>> puts Object.constants.select{|k| k =~ /google/i}.sort; nil
|
90
90
|
|
91
91
|
GoogleHashDenseLongToLong
|
92
92
|
GoogleHashSparseLongToLong
|
@@ -113,7 +113,7 @@ GoogleHashSparseRubyToInt
|
|
113
113
|
GoogleHashDenseRubyToRuby
|
114
114
|
GoogleHashSparseRubyToRuby
|
115
115
|
|
116
|
-
(long is "better" than int on 64 bit systems only)
|
116
|
+
(long is "better" than int on 64 bit systems only, on 32 bit it's the same)
|
117
117
|
|
118
118
|
and how to use them:
|
119
119
|
|
@@ -128,7 +128,7 @@ Use them like "normal" hashes, the method names try to map well.
|
|
128
128
|
|
129
129
|
If you have a desired use case that's not covered, let me know and I might well be able to code it up for you and add it.
|
130
130
|
|
131
|
-
ex: currently it uses longs internally instead of ints--if you want ints or
|
131
|
+
ex: currently it uses longs internally instead of ints--if you want ints or strings added, let me know.
|
132
132
|
|
133
133
|
if you want it to remember insertion order, I could do that, too, or native "store away" strings/bignums, whatever.
|
134
134
|
|
@@ -148,4 +148,4 @@ Related:
|
|
148
148
|
|
149
149
|
judy http://groups.google.com/group/ruby-talk-google/browse_thread/thread/05ed587925526a7f/314375891d12b672?lnk=raot
|
150
150
|
|
151
|
-
NArray gem : provides "native" type arrays (and X-Dimensional arrays--all in native memory, so also saves memory as this gem does)
|
151
|
+
NArray gem : provides "native" type arrays (and X-Dimensional arrays--all in native memory, so also saves memory as this gem does)
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# to actually build it locally, run extconf.rb in /ext, then make
|
2
2
|
|
3
|
-
require 'jeweler'
|
3
|
+
require 'jeweler' # 1.8.4 also libxml2-dev package on linux and libxslt-dev
|
4
4
|
Jeweler::Tasks.new do |gemspec|
|
5
5
|
gemspec.name = "google_hash"
|
6
6
|
gemspec.summary = "Ruby wrappers to the google hash library"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
data/changelog
CHANGED
data/ext/extconf.rb
CHANGED
@@ -20,6 +20,7 @@ Dir.chdir 'sparsehash-1.8.1' do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
$CFLAGS += " -I./local_installed/include "
|
23
|
+
$CPPFLAGS += " -I./local_installed/include "
|
23
24
|
|
24
25
|
if RUBY_VERSION < '1.9'
|
25
26
|
# appears to link using gcc on 1.8 [mingw at least]
|
@@ -106,4 +107,11 @@ end
|
|
106
107
|
template = ERB.new(File.read('template/main.cpp.erb'))
|
107
108
|
File.write 'main.cpp', template.result(binding)
|
108
109
|
|
110
|
+
Config::CONFIG['CPP'] = "g++ -E" # else cannot check for c++ headers? huh wuh?
|
111
|
+
have_header('tr1/functional')
|
112
|
+
|
113
|
+
if have_header('functional') && OS.x?
|
114
|
+
$CPPFLAGS += " -std=c++11 -stdlib=libc++ " # LLVM, no idea what I'm doing here...
|
115
|
+
end
|
116
|
+
|
109
117
|
create_makefile('google_hash')
|
@@ -1,17 +1,25 @@
|
|
1
1
|
#include <iostream>
|
2
2
|
#include <google/<%= type %>_hash_map>
|
3
3
|
#include <ruby.h>
|
4
|
-
#include <tr1/functional>
|
5
4
|
|
6
|
-
|
5
|
+
#if defined(HAVE_TR1_FUNCTIONAL)
|
6
|
+
#include <tr1/functional>
|
7
|
+
using std::tr1::hash;
|
8
|
+
#elif defined(HAVE_FUNCTIONAL)
|
9
|
+
#include <functional>
|
10
|
+
using std::hash; // llvm gets here [mac]
|
11
|
+
#else
|
12
|
+
// punt!
|
13
|
+
using __gnu_cxx::hash;
|
14
|
+
#endif
|
15
|
+
|
16
|
+
// much code stolen shamelessly from lourens' cb gem...
|
7
17
|
|
8
18
|
using google::<%= type %>_hash_map; // namespace where class lives by default
|
9
|
-
|
10
|
-
using std::endl;
|
19
|
+
|
11
20
|
<% if OS.posix? %>
|
12
|
-
#include <ext/hash_set>
|
21
|
+
#include <ext/hash_set> // ??
|
13
22
|
<% end %>
|
14
|
-
using std::tr1::hash; // or __gnu_cxx::hash, or maybe tr1::hash, depending on your OS
|
15
23
|
|
16
24
|
extern "C" {
|
17
25
|
|
data/google_hash.gemspec
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "google_hash"
|
8
|
+
s.version = "0.8.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["rogerdpack"]
|
12
|
+
s.date = "2014-02-19"
|
13
|
+
s.description = "Ruby wrappers to the google hash library"
|
14
|
+
s.email = "rogerdpack@gmail.com"
|
15
|
+
s.extensions = ["ext/extconf.rb"]
|
16
|
+
s.extra_rdoc_files = [
|
17
|
+
"README",
|
18
|
+
"TODO",
|
19
|
+
"changelog"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
"README",
|
23
|
+
"Rakefile",
|
24
|
+
"TODO",
|
25
|
+
"VERSION",
|
26
|
+
"changelog",
|
27
|
+
"ext/clean.bat",
|
28
|
+
"ext/extconf.rb",
|
29
|
+
"ext/go.bat",
|
30
|
+
"ext/sparsehash-1.8.1/AUTHORS",
|
31
|
+
"ext/sparsehash-1.8.1/COPYING",
|
32
|
+
"ext/sparsehash-1.8.1/ChangeLog",
|
33
|
+
"ext/sparsehash-1.8.1/INSTALL",
|
34
|
+
"ext/sparsehash-1.8.1/Makefile.am",
|
35
|
+
"ext/sparsehash-1.8.1/Makefile.in",
|
36
|
+
"ext/sparsehash-1.8.1/NEWS",
|
37
|
+
"ext/sparsehash-1.8.1/README",
|
38
|
+
"ext/sparsehash-1.8.1/README_windows.txt",
|
39
|
+
"ext/sparsehash-1.8.1/TODO",
|
40
|
+
"ext/sparsehash-1.8.1/aclocal.m4",
|
41
|
+
"ext/sparsehash-1.8.1/compile",
|
42
|
+
"ext/sparsehash-1.8.1/config.guess",
|
43
|
+
"ext/sparsehash-1.8.1/config.sub",
|
44
|
+
"ext/sparsehash-1.8.1/configure",
|
45
|
+
"ext/sparsehash-1.8.1/configure.ac",
|
46
|
+
"ext/sparsehash-1.8.1/depcomp",
|
47
|
+
"ext/sparsehash-1.8.1/doc/dense_hash_map.html",
|
48
|
+
"ext/sparsehash-1.8.1/doc/dense_hash_set.html",
|
49
|
+
"ext/sparsehash-1.8.1/doc/designstyle.css",
|
50
|
+
"ext/sparsehash-1.8.1/doc/implementation.html",
|
51
|
+
"ext/sparsehash-1.8.1/doc/index.html",
|
52
|
+
"ext/sparsehash-1.8.1/doc/performance.html",
|
53
|
+
"ext/sparsehash-1.8.1/doc/sparse_hash_map.html",
|
54
|
+
"ext/sparsehash-1.8.1/doc/sparse_hash_set.html",
|
55
|
+
"ext/sparsehash-1.8.1/doc/sparsetable.html",
|
56
|
+
"ext/sparsehash-1.8.1/experimental/Makefile",
|
57
|
+
"ext/sparsehash-1.8.1/experimental/README",
|
58
|
+
"ext/sparsehash-1.8.1/experimental/example.c",
|
59
|
+
"ext/sparsehash-1.8.1/experimental/libchash.c",
|
60
|
+
"ext/sparsehash-1.8.1/experimental/libchash.h",
|
61
|
+
"ext/sparsehash-1.8.1/google-sparsehash.sln",
|
62
|
+
"ext/sparsehash-1.8.1/install-sh",
|
63
|
+
"ext/sparsehash-1.8.1/m4/acx_pthread.m4",
|
64
|
+
"ext/sparsehash-1.8.1/m4/google_namespace.m4",
|
65
|
+
"ext/sparsehash-1.8.1/m4/namespaces.m4",
|
66
|
+
"ext/sparsehash-1.8.1/m4/stl_hash.m4",
|
67
|
+
"ext/sparsehash-1.8.1/m4/stl_hash_fun.m4",
|
68
|
+
"ext/sparsehash-1.8.1/m4/stl_namespace.m4",
|
69
|
+
"ext/sparsehash-1.8.1/missing",
|
70
|
+
"ext/sparsehash-1.8.1/mkinstalldirs",
|
71
|
+
"ext/sparsehash-1.8.1/packages/deb.sh",
|
72
|
+
"ext/sparsehash-1.8.1/packages/deb/README",
|
73
|
+
"ext/sparsehash-1.8.1/packages/deb/changelog",
|
74
|
+
"ext/sparsehash-1.8.1/packages/deb/compat",
|
75
|
+
"ext/sparsehash-1.8.1/packages/deb/control",
|
76
|
+
"ext/sparsehash-1.8.1/packages/deb/copyright",
|
77
|
+
"ext/sparsehash-1.8.1/packages/deb/docs",
|
78
|
+
"ext/sparsehash-1.8.1/packages/deb/rules",
|
79
|
+
"ext/sparsehash-1.8.1/packages/deb/sparsehash.dirs",
|
80
|
+
"ext/sparsehash-1.8.1/packages/deb/sparsehash.install",
|
81
|
+
"ext/sparsehash-1.8.1/packages/rpm.sh",
|
82
|
+
"ext/sparsehash-1.8.1/packages/rpm/rpm.spec",
|
83
|
+
"ext/sparsehash-1.8.1/src/config.h.in",
|
84
|
+
"ext/sparsehash-1.8.1/src/config.h.include",
|
85
|
+
"ext/sparsehash-1.8.1/src/google/dense_hash_map",
|
86
|
+
"ext/sparsehash-1.8.1/src/google/dense_hash_set",
|
87
|
+
"ext/sparsehash-1.8.1/src/google/sparse_hash_map",
|
88
|
+
"ext/sparsehash-1.8.1/src/google/sparse_hash_set",
|
89
|
+
"ext/sparsehash-1.8.1/src/google/sparsehash/densehashtable.h",
|
90
|
+
"ext/sparsehash-1.8.1/src/google/sparsehash/hashtable-common.h",
|
91
|
+
"ext/sparsehash-1.8.1/src/google/sparsehash/libc_allocator_with_realloc.h",
|
92
|
+
"ext/sparsehash-1.8.1/src/google/sparsehash/sparsehashtable.h",
|
93
|
+
"ext/sparsehash-1.8.1/src/google/sparsetable",
|
94
|
+
"ext/sparsehash-1.8.1/src/google/type_traits.h",
|
95
|
+
"ext/sparsehash-1.8.1/src/hash_test_interface.h",
|
96
|
+
"ext/sparsehash-1.8.1/src/hashtable_test.cc",
|
97
|
+
"ext/sparsehash-1.8.1/src/libc_allocator_with_realloc_test.cc",
|
98
|
+
"ext/sparsehash-1.8.1/src/simple_test.cc",
|
99
|
+
"ext/sparsehash-1.8.1/src/sparsetable_unittest.cc",
|
100
|
+
"ext/sparsehash-1.8.1/src/testutil.h",
|
101
|
+
"ext/sparsehash-1.8.1/src/time_hash_map.cc",
|
102
|
+
"ext/sparsehash-1.8.1/src/type_traits_unittest.cc",
|
103
|
+
"ext/sparsehash-1.8.1/src/windows/config.h",
|
104
|
+
"ext/sparsehash-1.8.1/src/windows/google/sparsehash/sparseconfig.h",
|
105
|
+
"ext/sparsehash-1.8.1/src/windows/port.cc",
|
106
|
+
"ext/sparsehash-1.8.1/src/windows/port.h",
|
107
|
+
"ext/sparsehash-1.8.1/vsprojects/hashtable_test/hashtable_test.vcproj",
|
108
|
+
"ext/sparsehash-1.8.1/vsprojects/simple_test/simple_test.vcproj",
|
109
|
+
"ext/sparsehash-1.8.1/vsprojects/sparsetable_unittest/sparsetable_unittest.vcproj",
|
110
|
+
"ext/sparsehash-1.8.1/vsprojects/time_hash_map/time_hash_map.vcproj",
|
111
|
+
"ext/sparsehash-1.8.1/vsprojects/type_traits_unittest/type_traits_unittest.vcproj",
|
112
|
+
"ext/spec.bat",
|
113
|
+
"ext/template/google_hash.cpp.erb",
|
114
|
+
"ext/template/main.cpp.erb",
|
115
|
+
"results.txt",
|
116
|
+
"spec/bench_gc.rb",
|
117
|
+
"spec/benchmark.rb",
|
118
|
+
"spec/scale.rb",
|
119
|
+
"spec/spec.google_hash.rb",
|
120
|
+
"to_build_locally_run_ext_go_bat"
|
121
|
+
]
|
122
|
+
s.homepage = "http://github.com/rdp/ruby_google_hash"
|
123
|
+
s.require_paths = ["lib"]
|
124
|
+
s.rubygems_version = "1.8.24"
|
125
|
+
s.summary = "Ruby wrappers to the google hash library"
|
126
|
+
|
127
|
+
if s.respond_to? :specification_version then
|
128
|
+
s.specification_version = 3
|
129
|
+
|
130
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
131
|
+
s.add_runtime_dependency(%q<sane>, [">= 0"])
|
132
|
+
s.add_development_dependency(%q<hitimes>, [">= 0"])
|
133
|
+
else
|
134
|
+
s.add_dependency(%q<sane>, [">= 0"])
|
135
|
+
s.add_dependency(%q<hitimes>, [">= 0"])
|
136
|
+
end
|
137
|
+
else
|
138
|
+
s.add_dependency(%q<sane>, [">= 0"])
|
139
|
+
s.add_dependency(%q<hitimes>, [">= 0"])
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sane
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- ext/spec.bat
|
147
147
|
- ext/template/google_hash.cpp.erb
|
148
148
|
- ext/template/main.cpp.erb
|
149
|
+
- google_hash.gemspec
|
149
150
|
- results.txt
|
150
151
|
- spec/bench_gc.rb
|
151
152
|
- spec/benchmark.rb
|