├── ChangeLog.txt ├── LICENSE ├── README ├── Rakefile ├── TODO ├── VERSION ├── ext ├── .gitignore ├── clean.bat ├── extconf.rb ├── go.bat ├── go.sh ├── sparsehash-2.0.2 │ ├── AUTHORS │ ├── COPYING │ ├── ChangeLog │ ├── INSTALL │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── README │ ├── README_windows.txt │ ├── TODO │ ├── aclocal.m4 │ ├── allocator.patch │ ├── config.guess │ ├── config.sub │ ├── configure │ ├── configure.ac │ ├── depcomp │ ├── doc │ │ ├── dense_hash_map.html │ │ ├── dense_hash_set.html │ │ ├── designstyle.css │ │ ├── implementation.html │ │ ├── index.html │ │ ├── performance.html │ │ ├── sparse_hash_map.html │ │ ├── sparse_hash_set.html │ │ └── sparsetable.html │ ├── experimental │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── Makefile.svn-base │ │ │ │ ├── README.svn-base │ │ │ │ ├── example.c.svn-base │ │ │ │ ├── libchash.c.svn-base │ │ │ │ └── libchash.h.svn-base │ │ ├── Makefile │ │ ├── README │ │ ├── example.c │ │ ├── libchash.c │ │ └── libchash.h │ ├── install-sh │ ├── m4 │ │ ├── acx_pthread.m4 │ │ ├── google_namespace.m4 │ │ ├── namespaces.m4 │ │ ├── stl_hash.m4 │ │ └── stl_hash_fun.m4 │ ├── missing │ ├── packages │ │ ├── deb.sh │ │ ├── deb │ │ │ ├── .svn │ │ │ │ ├── all-wcprops │ │ │ │ ├── entries │ │ │ │ ├── prop-base │ │ │ │ │ └── rules.svn-base │ │ │ │ └── text-base │ │ │ │ │ ├── README.svn-base │ │ │ │ │ ├── changelog.svn-base │ │ │ │ │ ├── compat.svn-base │ │ │ │ │ ├── control.svn-base │ │ │ │ │ ├── copyright.svn-base │ │ │ │ │ ├── docs.svn-base │ │ │ │ │ ├── rules.svn-base │ │ │ │ │ ├── sparsehash.dirs.svn-base │ │ │ │ │ └── sparsehash.install.svn-base │ │ │ ├── README │ │ │ ├── changelog │ │ │ ├── compat │ │ │ ├── control │ │ │ ├── copyright │ │ │ ├── docs │ │ │ ├── rules │ │ │ ├── sparsehash.dirs │ │ │ └── sparsehash.install │ │ ├── rpm.sh │ │ └── rpm │ │ │ └── rpm.spec │ ├── sparsehash.sln │ ├── src │ │ ├── config.h.in │ │ ├── config.h.include │ │ ├── google │ │ │ ├── dense_hash_map │ │ │ ├── dense_hash_set │ │ │ ├── sparse_hash_map │ │ │ ├── sparse_hash_set │ │ │ ├── sparsehash │ │ │ │ ├── densehashtable.h │ │ │ │ ├── hashtable-common.h │ │ │ │ ├── libc_allocator_with_realloc.h │ │ │ │ └── sparsehashtable.h │ │ │ ├── sparsetable │ │ │ ├── template_util.h │ │ │ └── type_traits.h │ │ ├── hash_test_interface.h │ │ ├── hashtable_test.cc │ │ ├── libc_allocator_with_realloc_test.cc │ │ ├── simple_compat_test.cc │ │ ├── simple_test.cc │ │ ├── sparsehash │ │ │ ├── dense_hash_map │ │ │ ├── dense_hash_set │ │ │ ├── internal │ │ │ │ ├── densehashtable.h │ │ │ │ ├── hashtable-common.h │ │ │ │ ├── libc_allocator_with_realloc.h │ │ │ │ └── sparsehashtable.h │ │ │ ├── sparse_hash_map │ │ │ ├── sparse_hash_set │ │ │ ├── sparsetable │ │ │ ├── template_util.h │ │ │ └── type_traits.h │ │ ├── sparsetable_unittest.cc │ │ ├── stamp-h1 │ │ ├── template_util_unittest.cc │ │ ├── testutil.h │ │ ├── time_hash_map.cc │ │ ├── type_traits_unittest.cc │ │ └── windows │ │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ ├── config.h.svn-base │ │ │ │ ├── port.cc.svn-base │ │ │ │ └── port.h.svn-base │ │ │ ├── config.h │ │ │ ├── google │ │ │ ├── .svn │ │ │ │ ├── all-wcprops │ │ │ │ └── entries │ │ │ └── sparsehash │ │ │ │ ├── .svn │ │ │ │ ├── all-wcprops │ │ │ │ ├── entries │ │ │ │ └── text-base │ │ │ │ │ └── sparseconfig.h.svn-base │ │ │ │ └── sparseconfig.h │ │ │ ├── port.cc │ │ │ ├── port.h │ │ │ └── sparsehash │ │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ └── entries │ │ │ └── internal │ │ │ ├── .svn │ │ │ ├── all-wcprops │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ └── sparseconfig.h.svn-base │ │ │ └── sparseconfig.h │ └── vsprojects │ │ ├── hashtable_test │ │ └── hashtable_test.vcproj │ │ ├── libc_allocator_with_realloc_test │ │ └── libc_allocator_with_realloc_test.vcproj │ │ ├── simple_test │ │ └── simple_test.vcproj │ │ ├── sparsetable_unittest │ │ └── sparsetable_unittest.vcproj │ │ ├── time_hash_map │ │ └── time_hash_map.vcproj │ │ └── type_traits_unittest │ │ └── type_traits_unittest.vcproj ├── spec.bat └── template │ ├── google_hash.cpp.erb │ └── main.cpp.erb ├── google_hash.gemspec ├── results.txt ├── spec ├── bench_gc.rb ├── benchmark.rb ├── scale.rb └── spec.google_hash.rb └── to_build_locally_run_ext_go_bat /ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 0.8.9 2 | hopefully fix build failure OS X newer xcode releases 3 | 4 | 0.8.8 5 | re-deploy from corrupted deploy [?] 6 | 7 | 0.8.7 8 | add #each_pair method 9 | 10 | 0.8.6 11 | add #size method 12 | 13 | 0.8.5 14 | fix build for 2.2.x [I hope] 15 | 16 | 0.8.4 17 | attempt to fix poor build/gem distro 18 | 19 | 0.8.3 20 | add #delete method to DenseHash 21 | 22 | 0.8.2 23 | hopefully building for os x mavericks'ish gcc's now 24 | 25 | 0.8.1: 26 | work with OS X newer compilers 27 | 28 | 0.8.0: 29 | add a delete method for the Sparse** classes 30 | actually delete the hashmaps when the object is collected by Ruby, instead of leaking 31 | hopefully work with more versions of GCC 32 | 33 | 0.7.0: 34 | fix building in linux with newer GCC's, fix building in windows with broken system command (?) 35 | bump internal google_hash version to 0.8.2 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018, Roger Pack. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | The "google_hash" gem. 2 | 3 | Its goal. To boldly be faster than any ruby hash has before (cue star trek TNG theme...). 4 | 5 | Well, really the goal is a better hash for Ruby, either one that is faster or more space efficient than ruby's default. 6 | To attempt to accomplish this, this library wraps the google hash sparse and dense hashes [1], which may perform better 7 | for your use case [make sure to benchmark before and after!]. 8 | It also creates some "specialized" hashes, for instance, those that take an integer for their key, for even better performance 9 | and decreased "garbage collected" RAM use, which can significantely speed up certain apps. 10 | 11 | # how to run this benchmark: 12 | 13 | $ cd ext && ruby extconf.rb && make 14 | $ cd ../spec 15 | $ ruby benchmark.rb 16 | 17 | ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] 18 | inserting 400000 objects 19 | 20 | Ruby Standard Hash 21 | populate integer 0.324 22 | #each 0.660 23 | lookup int 0.083 24 | 25 | GoogleHashDenseIntToRuby 26 | populate integer 0.114 27 | #each 0.050 28 | lookup int 0.080 29 | 30 | 31 | GoogleHashSparseIntToInt # said to be more memory efficient 32 | populate integer 0.242 33 | #each 0.046 34 | lookup int 0.099 35 | 36 | These also use less memory, because (if you specify IntToInt, it stores only 4 bytes per int, instead of Ruby's 37 | usual 20 bytes), and usually less overall RAM for the hash store. 38 | This also frees up Ruby so it doesn't hvae to garbage collect as much. Yea! 39 | 40 | For instance, with 1M ints, doing a GC takes this long, comparatively: 41 | GoogleHashDenseIntToInt "dense took 0.002" 42 | "ruby hash took 0.103" 43 | 44 | per GC. And those garbage collects happen all the time, so this is meant to speed those up. 45 | 46 | See also the results.txt file for more OS benchmark results. 47 | 48 | You can also run your own benchmarks to see how much faster it would be for you ("try before you buy"), see spec/benchmark.rb file. 49 | 50 | The best benchmark, of course, is to integrate and run it in your own app. 51 | 52 | Here is how it performs, if used as a "replacement" for the Ruby standard Hash: 53 | 54 | Ruby Standard Hash 55 | populate string 0.252 56 | populate symbol 0.109 57 | populate integer 0.324 58 | #each 0.660 59 | lookup int 0.083 60 | lookup string 0.642 61 | lookup symbol 0.082 62 | 63 | GoogleHashDenseRubyToRuby 64 | populate string 0.312 # slower here 65 | populate symbol 0.136 66 | populate integer 0.172 67 | #each 0.077 68 | lookup int 0.102 69 | lookup string 0.271 70 | lookup symbol 0.098 71 | 72 | GoogleHashSparseRubyToRuby 73 | populate string 0.276 74 | populate symbol 0.102 75 | populate integer 0.428 76 | #each 0.047 77 | lookup int 0.098 78 | lookup string 0.293 79 | lookup symbol 0.099 80 | 81 | basically slightly slower, except for an #each method that is *much* faster, and, as I said, RAM usage might be much better using this than the standard Ruby hash, esp. 82 | for the case of the Sparse version. 83 | 84 | == Installation == 85 | 86 | gem install google_hash (if on windows, you'll also need the devkit installed). 87 | 88 | == usage == 89 | 90 | a = GoogleHashDenseRubyToRuby.new # like a normal Ruby hash, with slightly different performance characteristics, see results.txt 91 | b = GoogleHashDenseIntToRuby.new # :int => Ruby -- keys are stored as "native" ints, values are ruby objects 92 | c = GoogleHashSparseIntToInt.new # :int => :int 93 | 94 | Here's the full list of availables: 95 | 96 | >> puts Object.constants.select{|k| k =~ /google/i}.sort; nil 97 | 98 | GoogleHashDenseLongToLong 99 | GoogleHashSparseLongToLong 100 | GoogleHashDenseLongToInt 101 | GoogleHashSparseLongToInt 102 | GoogleHashDenseLongToRuby 103 | GoogleHashSparseLongToRuby 104 | GoogleHashDenseDoubleToLong 105 | GoogleHashSparseDoubleToLong 106 | GoogleHashDenseDoubleToInt 107 | GoogleHashSparseDoubleToInt 108 | GoogleHashDenseDoubleToRuby 109 | GoogleHashSparseDoubleToRuby 110 | GoogleHashDenseIntToLong 111 | GoogleHashSparseIntToLong 112 | GoogleHashDenseIntToInt 113 | GoogleHashSparseIntToInt 114 | GoogleHashDenseIntToRuby 115 | GoogleHashSparseIntToRuby 116 | GoogleHashDenseRubyToLong 117 | GoogleHashSparseRubyToLong 118 | GoogleHashDenseRubyToInt 119 | GoogleHashSparseRubyToInt 120 | GoogleHashDenseRubyToRuby 121 | GoogleHashSparseRubyToRuby 122 | 123 | (long is "better" than int on 64 bit systems only, on 32 bit it's the same) 124 | 125 | and how to use them: 126 | 127 | a[3] = 4 128 | b[4] = 'abc' 129 | b['abc'] = 'some complex object' 130 | c[3] = 4 # all you can use are ints... 131 | 132 | Use them like "normal" hashes, the method names try to map well. 133 | 134 | == feedback == 135 | 136 | 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. 137 | 138 | ex: currently it uses longs internally instead of ints--if you want ints or strings added, let me know. 139 | 140 | if you want it to remember insertion order, I could do that, too, or native "store away" strings/bignums, whatever. 141 | 142 | Could also add vectors, vector(pairs), priority queues, floats, native bignums, other more complex types, if anybody wants me to. 143 | 144 | This is meant to be one more tool in the rubyists toolbelt when trying to optimize speed-wise, and plans to expand to more types, but at least with this release it has a #each method. 145 | 146 | Could add #sum methods, etc. for the numeric types, for instance. 147 | 148 | Enjoy. 149 | 150 | -r 151 | 152 | [1] http://code.google.com/p/google-sparsehash 153 | 154 | If you want to see the code/hack on it, run extconf.rb within the ext directory, to create the code it actually uses (from a template). 155 | 156 | Related: 157 | 158 | judy http://groups.google.com/group/ruby-talk-google/browse_thread/thread/05ed587925526a7f/314375891d12b672?lnk=raot 159 | 160 | NArray gem : provides "native" type arrays (and X-Dimensional arrays--all in native memory, so also saves memory as this gem does) 161 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # to actually build it locally, run extconf.rb in /ext, then make 2 | 3 | require 'jeweler' # 1.8.4 also libxml2-dev package on linux and libxslt-dev 4 | Jeweler::Tasks.new do |gemspec| 5 | gemspec.name = "google_hash" 6 | gemspec.summary = "Ruby wrappers to the google hash library" 7 | gemspec.description = gemspec.summary 8 | gemspec.email = "rogerdpack@gmail.com" 9 | gemspec.homepage = "http://github.com/rdp/ruby_google_hash" 10 | gemspec.authors = ["rogerdpack"] 11 | gemspec.add_runtime_dependency 'sane', '~> 0' # real dependency as it's used for building the gem, in the extconf.rb file itself, but not actually required by the gem at runtime 12 | gemspec.add_development_dependency('hitimes', '~> 0') 13 | gemspec.add_development_dependency('rspec', '~> 2.14.1') 14 | gemspec.add_development_dependency('jeweler') 15 | end 16 | 17 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | = maybe = 2 | can you use GoogleHashDenseDouble *any way*? 3 | I think there's a spec that calls this out LOL 4 | 5 | fix it being able to store those larger numbers [on demand] [failing specs] 6 | on demand 7 | 8 | the spec file itself lists various todo's 9 | 10 | auto-serialize [hmm...they can already do this in ruby tho...] 11 | 12 | could be faster [?]: 13 | 14 | http://code.google.com/p/ulib/wiki/AlignedHashingPerformance 15 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.8.9 -------------------------------------------------------------------------------- /ext/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.cpp 3 | sparsehash-2.0.2 4 | -------------------------------------------------------------------------------- /ext/clean.bat: -------------------------------------------------------------------------------- 1 | rm *.cpp 2 | rm *.o 3 | rm -f *.so 4 | rm -f *.def 5 | rm *.bundle 6 | rm mkmf.log 7 | -------------------------------------------------------------------------------- /ext/extconf.rb: -------------------------------------------------------------------------------- 1 | require 'mkmf' 2 | require 'erb' 3 | require 'rubygems' 4 | require 'sane' 5 | 6 | # re-build google's lib locally... 7 | dir = Dir.pwd 8 | Dir.chdir 'sparsehash-2.0.2' do 9 | dir = dir + '/local_installed' 10 | # only if haven't already built it...except who installing a gem would ever have it already there? reinstallers? 11 | unless File.directory?(dir) 12 | puts 'building local copy/version of google sparse/dense hash library' 13 | configure = "sh configure --prefix=#{dir}" 14 | puts configure 15 | system configure 16 | system "make #{ARGV[0]}" # allow ruby extconf.rb -j 2 for parallel/faster builds 17 | system "make install" 18 | end 19 | end 20 | 21 | $CFLAGS += " -I./local_installed/include " 22 | $CPPFLAGS += " -I./local_installed/include " 23 | 24 | puts "running from #{Dir.pwd}" 25 | 26 | if RUBY_VERSION < '1.9' 27 | # appears to need this to link using gcc on 1.8 [mingw at least] 28 | $LDFLAGS += " -lstdc++ " 29 | end 30 | 31 | # create our files... 32 | 33 | if OS.bits == 32 34 | unreachable_int = "1<<31" 35 | unreachable_long = "1<<31" 36 | else 37 | unreachable_int = "1<<31" 38 | unreachable_long = "(long) 1<<63" # TODO NaN here instead or something? land mine otherwise? hmm... 39 | end 40 | 41 | ruby_key = {:convert_keys_from_ruby => "", :convert_keys_to_ruby => "", :key_type => "VALUE", :english_key_type => "ruby", 42 | :extra_hash_params => ", hashrb, eqrb", :unreachable_key => "current_instance"} # TODO unreachable -> NULL instead? 43 | 44 | int_key = {:assert_key_type => 'T_FIXNUM', :convert_keys_from_ruby => "FIX2INT", 45 | :convert_keys_to_ruby => "INT2FIX", :key_type => "int", :unreachable_key => "#{unreachable_int}"} 46 | 47 | # "long" is useful on 64 bit...since it can handle a wider range of incoming int's 48 | 49 | long_key = {:assert_key_type => 'T_FIXNUM', :convert_keys_from_ruby => "FIX2LONG", 50 | :convert_keys_to_ruby => "LONG2FIX", :key_type => "long", :unreachable_key => "#{unreachable_long}"} 51 | 52 | # currently "big numbers" we handle by storing them as a double 53 | # TODO floats [does ruby do real doubles underneath?] too 54 | bignum_as_double_key = {:assert_key_type => ['T_BIGNUM', 'T_FIXNUM'], :convert_keys_from_ruby => "rb_big2dbl", 55 | :convert_keys_to_ruby => "rb_dbl2big", :key_type => "double", :unreachable_key => "#{unreachable_long}", # LODO is this a bignum value though? LODO TEST this key on 64 bit! 56 | #:extra_hash_params => ", hashdouble, eqdouble", # these methods provided natively these days? 57 | :extra_set_code => "if(TYPE(set_this) == T_FIXNUM)\nset_this = rb_int2big(FIX2INT(set_this));", 58 | :extra_get_code => "if(TYPE(get_this) == T_FIXNUM) \n get_this = rb_int2big(FIX2INT(get_this));" 59 | } 60 | 61 | ruby_value = {:value_type => "VALUE", :english_value_type => "ruby"} 62 | int_value = {:assert_value_type => 'T_FIXNUM', :convert_values_from_ruby => "FIX2INT", 63 | :convert_values_to_ruby => "INT2FIX", :value_type => "int"} 64 | long_value = {:assert_value_type => 'T_FIXNUM', :convert_values_from_ruby => "FIX2LONG", 65 | :convert_values_to_ruby => "LONG2FIX", :value_type => "long"} 66 | 67 | bignum_as_double_value = {:assert_value_type => ['T_BIGNUM', 'T_FIXNUM'], :convert_values_from_ruby => "rb_big2dbl", 68 | :convert_values_to_ruby => "rb_dbl2big", :value_type => "double", 69 | :extra_set_code2 => "if(TYPE(to_this) == T_FIXNUM)\nto_this = rb_int2big(FIX2INT(to_this));" 70 | } 71 | 72 | init_funcs = [] 73 | 74 | for key in [ruby_key, int_key, bignum_as_double_key, long_key] do 75 | for value in [ruby_value, int_value, long_value, bignum_as_double_value] do 76 | options = key.merge(value) 77 | for type in ['sparse', 'dense'] do 78 | 79 | # create local variables so that the template can look cleaner 80 | unreachable_key = options[:unreachable_key] 81 | convert_keys_from_ruby = options[:convert_keys_from_ruby] 82 | convert_keys_to_ruby = options[:convert_keys_to_ruby] 83 | key_type = options[:key_type] 84 | value_type = options[:value_type] 85 | english_key_type = options[:english_key_type] || options[:key_type] 86 | english_value_type = options[:english_value_type] || options[:value_type] 87 | 88 | 89 | assert_key_type = [options[:assert_key_type]].flatten[0] 90 | assert_key_type2 = [options[:assert_key_type]].flatten[1] 91 | convert_values_from_ruby = options[:convert_values_from_ruby] 92 | convert_values_to_ruby = options[:convert_values_to_ruby] 93 | assert_value_type = [options[:assert_value_type]].flatten[0] 94 | assert_value_type2 = [options[:assert_value_type]].flatten[1] 95 | 96 | extra_hash_params = options[:extra_hash_params] 97 | 98 | template = ERB.new(File.read('template/google_hash.cpp.erb')) 99 | descriptor = type + '_' + english_key_type + '_to_' + english_value_type; 100 | File.write(descriptor + '.cpp', template.result(binding)) 101 | init_funcs << "init_" + descriptor 102 | end 103 | end 104 | end 105 | 106 | # write our Init method 107 | 108 | template = ERB.new(File.read('template/main.cpp.erb')) 109 | File.write 'main.cpp', template.result(binding) 110 | 111 | RbConfig::CONFIG['CPP'] = "g++ -E" # else cannot check for c++ headers? huh wuh? 112 | have_header('tr1/functional') 113 | 114 | if have_header('functional') && OS.x? && !have_header('tr1/functional') 115 | $CPPFLAGS += " -std=c++11 -stdlib=libc++ " # LLVM, updated to not have tr1 anymore, no idea what I'm doing here... 116 | end 117 | 118 | create_makefile('google_hash') 119 | -------------------------------------------------------------------------------- /ext/go.bat: -------------------------------------------------------------------------------- 1 | call clean.bat 2 | ruby extconf.rb 3 | call make -j 2 4 | spec.bat -------------------------------------------------------------------------------- /ext/go.sh: -------------------------------------------------------------------------------- 1 | ./clean.bat 2 | ruby extconf.rb -j8 3 | make -j8 4 | ./spec.bat 5 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/AUTHORS: -------------------------------------------------------------------------------- 1 | google-sparsehash@googlegroups.com 2 | 3 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/README_windows.txt: -------------------------------------------------------------------------------- 1 | This project has been ported to Windows. A working solution file 2 | exists in this directory: 3 | sparsehash.sln 4 | 5 | You can load this solution file into either VC++ 7.1 (Visual Studio 6 | 2003) or VC++ 8.0 (Visual Studio 2005) -- in the latter case, it will 7 | automatically convert the files to the latest format for you. 8 | 9 | When you build the solution, it will create a number of 10 | unittests,which you can run by hand (or, more easily, under the Visual 11 | Studio debugger) to make sure everything is working properly on your 12 | system. The binaries will end up in a directory called "debug" or 13 | "release" in the top-level directory (next to the .sln file). 14 | 15 | Note that these systems are set to build in Debug mode by default. 16 | You may want to change them to Release mode. 17 | 18 | I have little experience with Windows programming, so there may be 19 | better ways to set this up than I've done! If you run across any 20 | problems, please post to the google-sparsehash Google Group, or report 21 | them on the sparsehash Google Code site: 22 | http://groups.google.com/group/google-sparsehash 23 | http://code.google.com/p/sparsehash/issues/list 24 | 25 | -- craig 26 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/TODO: -------------------------------------------------------------------------------- 1 | 1) TODO: I/O implementation in densehashtable.h 2 | 3 | 2) TODO: document SPARSEHASH_STAT_UPDATE macro, and also macros that 4 | tweak performance. Perhaps add support to these to the API? 5 | 6 | 3) TODO: support exceptions? 7 | 8 | 4) BUG: sparsetable's operator[] doesn't work well with printf: you 9 | need to explicitly cast the result to value_type to print it. (It 10 | works fine with streams.) 11 | 12 | 5) TODO: consider rewriting dense_hash_map to use a 'groups' scheme, 13 | like sparsetable, but without the sparse-allocation within a 14 | group. This makes resizing have better memory-use properties. The 15 | downside is that probes across groups might take longer since 16 | groups are not contiguous in memory. Making groups the same size 17 | as a cache-line, and ensuring they're loaded on cache-line 18 | boundaries, might help. Needs careful testing to make sure it 19 | doesn't hurt performance. 20 | 21 | 6) TODO: Get the C-only version of sparsehash in experimental/ ready 22 | for prime-time. 23 | 24 | 7) TODO: use cmake (www.cmake.org) to make it easy to isntall this on 25 | a windows system. 26 | 27 | --- 28 | 28 February 2007 29 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/allocator.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/sparsehash/internal/sparsehashtable.h b/src/sparsehash/internal/sparsehashtable.h 2 | index 7ee1391..f54ea51 100644 3 | --- a/src/sparsehash/internal/sparsehashtable.h 4 | +++ b/src/sparsehash/internal/sparsehashtable.h 5 | @@ -165,7 +165,7 @@ struct sparse_hashtable_iterator { 6 | public: 7 | typedef sparse_hashtable_iterator iterator; 8 | typedef sparse_hashtable_const_iterator const_iterator; 9 | - typedef typename sparsetable::nonempty_iterator 10 | + typedef typename sparsetable::nonempty_iterator 11 | st_iterator; 12 | 13 | typedef std::forward_iterator_tag iterator_category; // very little defined! 14 | @@ -217,7 +217,7 @@ struct sparse_hashtable_const_iterator { 15 | public: 16 | typedef sparse_hashtable_iterator iterator; 17 | typedef sparse_hashtable_const_iterator const_iterator; 18 | - typedef typename sparsetable::const_nonempty_iterator 19 | + typedef typename sparsetable::const_nonempty_iterator 20 | st_iterator; 21 | 22 | typedef std::forward_iterator_tag iterator_category; // very little defined! 23 | @@ -271,7 +271,7 @@ struct sparse_hashtable_destructive_iterator { 24 | 25 | public: 26 | typedef sparse_hashtable_destructive_iterator iterator; 27 | - typedef typename sparsetable::destructive_iterator 28 | + typedef typename sparsetable::destructive_iterator 29 | st_iterator; 30 | 31 | typedef std::forward_iterator_tag iterator_category; // very little defined! 32 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/configure.ac: -------------------------------------------------------------------------------- 1 | ## Process this file with autoconf to produce configure. 2 | ## In general, the safest way to proceed is to run ./autogen.sh 3 | 4 | # make sure we're interpreted by some minimal autoconf 5 | AC_PREREQ(2.57) 6 | 7 | AC_INIT(sparsehash, 2.0.2, google-sparsehash@googlegroups.com) 8 | # The argument here is just something that should be in the current directory 9 | # (for sanity checking) 10 | AC_CONFIG_SRCDIR(README) 11 | AM_INIT_AUTOMAKE([dist-zip]) 12 | AM_CONFIG_HEADER(src/config.h) 13 | 14 | # Checks for programs. 15 | AC_PROG_CXX 16 | AC_PROG_CC 17 | AC_PROG_CPP 18 | AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc 19 | 20 | # Check whether some low-level functions/files are available 21 | AC_HEADER_STDC 22 | AC_CHECK_FUNCS(memcpy memmove) 23 | AC_CHECK_TYPES([uint16_t]) # defined in C99 systems 24 | AC_CHECK_TYPES([u_int16_t]) # defined in BSD-derived systems, and gnu 25 | AC_CHECK_TYPES([__uint16]) # defined in some windows systems (vc7) 26 | AC_CHECK_TYPES([long long]) # probably defined everywhere, but... 27 | 28 | # These are 'only' needed for unittests 29 | AC_CHECK_HEADERS(sys/resource.h unistd.h sys/time.h sys/utsname.h) 30 | 31 | # If you have google-perftools installed, we can do a bit more testing. 32 | # We not only want to set HAVE_MALLOC_EXTENSION_H, we also want to set 33 | # a variable to let the Makefile to know to link in tcmalloc. 34 | AC_LANG([C++]) 35 | AC_CHECK_HEADERS(google/malloc_extension.h, 36 | tcmalloc_libs=-ltcmalloc, 37 | tcmalloc_libs=) 38 | # On some systems, when linking in tcmalloc you also need to link in 39 | # pthread. That's a bug somewhere, but we'll work around it for now. 40 | tcmalloc_flags="" 41 | if test -n "$tcmalloc_libs"; then 42 | ACX_PTHREAD 43 | tcmalloc_flags="\$(PTHREAD_CFLAGS)" 44 | tcmalloc_libs="$tcmalloc_libs \$(PTHREAD_LIBS)" 45 | fi 46 | AC_SUBST(tcmalloc_flags) 47 | AC_SUBST(tcmalloc_libs) 48 | 49 | # Figure out where hash_map lives and also hash_fun.h (or stl_hash_fun.h). 50 | # This also tells us what namespace hash code lives in. 51 | AC_CXX_STL_HASH 52 | AC_CXX_STL_HASH_FUN 53 | 54 | # Find out what namespace the user wants our classes to be defined in. 55 | # TODO(csilvers): change this to default to sparsehash instead. 56 | AC_DEFINE_GOOGLE_NAMESPACE(google) 57 | 58 | # In unix-based systems, hash is always defined as hash<> (in namespace. 59 | # HASH_NAMESPACE.) So we can use a simple AC_DEFINE here. On 60 | # windows, and possibly on future unix STL implementations, this 61 | # macro will evaluate to something different.) 62 | AC_DEFINE(SPARSEHASH_HASH_NO_NAMESPACE, hash, 63 | [The system-provided hash function, in namespace HASH_NAMESPACE.]) 64 | 65 | # Do *not* define this in terms of SPARSEHASH_HASH_NO_NAMESPACE, because 66 | # SPARSEHASH_HASH is exported to sparseconfig.h, but S_H_NO_NAMESPACE isn't. 67 | AC_DEFINE(SPARSEHASH_HASH, HASH_NAMESPACE::hash, 68 | [The system-provided hash function including the namespace.]) 69 | 70 | 71 | # Write generated configuration file 72 | AC_CONFIG_FILES([Makefile]) 73 | AC_OUTPUT 74 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/doc/designstyle.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #ffffff; 3 | color: black; 4 | margin-right: 1in; 5 | margin-left: 1in; 6 | } 7 | 8 | 9 | h1, h2, h3, h4, h5, h6 { 10 | color: #3366ff; 11 | font-family: sans-serif; 12 | } 13 | @media print { 14 | /* Darker version for printing */ 15 | h1, h2, h3, h4, h5, h6 { 16 | color: #000080; 17 | font-family: helvetica, sans-serif; 18 | } 19 | } 20 | 21 | h1 { 22 | text-align: center; 23 | font-size: 18pt; 24 | } 25 | h2 { 26 | margin-left: -0.5in; 27 | } 28 | h3 { 29 | margin-left: -0.25in; 30 | } 31 | h4 { 32 | margin-left: -0.125in; 33 | } 34 | hr { 35 | margin-left: -1in; 36 | } 37 | 38 | /* Definition lists: definition term bold */ 39 | dt { 40 | font-weight: bold; 41 | } 42 | 43 | address { 44 | text-align: right; 45 | } 46 | /* Use the tag for bits of code and for variables and objects. */ 47 | code,pre,samp,var { 48 | color: #006000; 49 | } 50 | /* Use the tag for file and directory paths and names. */ 51 | file { 52 | color: #905050; 53 | font-family: monospace; 54 | } 55 | /* Use the tag for stuff the user should type. */ 56 | kbd { 57 | color: #600000; 58 | } 59 | div.note p { 60 | float: right; 61 | width: 3in; 62 | margin-right: 0%; 63 | padding: 1px; 64 | border: 2px solid #6060a0; 65 | background-color: #fffff0; 66 | } 67 | 68 | UL.nobullets { 69 | list-style-type: none; 70 | list-style-image: none; 71 | margin-left: -1em; 72 | } 73 | 74 | /* pretty printing styles. See prettify.js */ 75 | .str { color: #080; } 76 | .kwd { color: #008; } 77 | .com { color: #800; } 78 | .typ { color: #606; } 79 | .lit { color: #066; } 80 | .pun { color: #660; } 81 | .pln { color: #000; } 82 | .tag { color: #008; } 83 | .atn { color: #606; } 84 | .atv { color: #080; } 85 | pre.prettyprint { padding: 2px; border: 1px solid #888; } 86 | 87 | .embsrc { background: #eee; } 88 | 89 | @media print { 90 | .str { color: #060; } 91 | .kwd { color: #006; font-weight: bold; } 92 | .com { color: #600; font-style: italic; } 93 | .typ { color: #404; font-weight: bold; } 94 | .lit { color: #044; } 95 | .pun { color: #440; } 96 | .pln { color: #000; } 97 | .tag { color: #006; font-weight: bold; } 98 | .atn { color: #404; } 99 | .atv { color: #060; } 100 | } 101 | 102 | /* Table Column Headers */ 103 | .hdr { 104 | color: #006; 105 | font-weight: bold; 106 | background-color: #dddddd; } 107 | .hdr2 { 108 | color: #006; 109 | background-color: #eeeeee; } -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sparsehash Package (formerly Google Sparsehash) 5 | 6 | 7 | 8 | 24 | 25 | 26 | 27 |

Sparsehash Package (formerly 28 | Google Sparsehash)

29 |
30 | 31 |

The sparsehash package consists of two hashtable 32 | implementations: sparse, which is designed to be very space 33 | efficient, and dense, which is designed to be very time 34 | efficient. For each one, the package provides both a hash-map and a 35 | hash-set, to mirror the classes in the common STL implementation.

36 | 37 |

Documentation on how to use these classes:

38 | 44 | 45 |

In addition to the hash-map (and hash-set) classes, there's also a 46 | lower-level class that implements a "sparse" array. This class can be 47 | useful in its own right; consider using it when you'd normally use a 48 | sparse_hash_map, but your keys are all small-ish 49 | integers.

50 | 53 | 54 |

There is also a doc explaining the implementation details of these 56 | classes, for those who are curious. And finally, you can see some 57 | performance comparisons, both between 58 | the various classes here, but also between these implementations and 59 | other standard hashtable implementations.

60 | 61 |
62 |
63 | Craig Silverstein
64 | Last modified: Thu Jan 25 17:58:02 PST 2007 65 |
66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/doc/performance.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Performance notes: sparse_hash, dense_hash, sparsetable 5 | 6 | 7 | 8 | 9 |

Performance Numbers

10 | 11 |

Here are some performance numbers from an example desktop machine, 12 | taken from a version of time_hash_map that was instrumented to also 13 | report memory allocation information (this modification is not 14 | included by default because it required a big hack to do, including 15 | modifying the STL code to not try to do its own freelist management).

16 | 17 |

Note there are lots of caveats on these numbers: they may differ from 18 | machine to machine and compiler to compiler, and they only test a very 19 | particular usage pattern that may not match how you use hashtables -- 20 | for instance, they test hashtables with very small keys. However, 21 | they're still useful for a baseline comparison of the various 22 | hashtable implementations.

23 | 24 |

These figures are from a 2.80GHz Pentium 4 with 2G of memory. The 25 | 'standard' hash_map and map implementations are the SGI STL code 26 | included with gcc2. Compiled with gcc2.95.3 -g 27 | -O2

28 | 29 |
30 | ======
31 | Average over 10000000 iterations
32 | Wed Dec  8 14:56:38 PST 2004
33 | 
34 | SPARSE_HASH_MAP:
35 | map_grow                  665 ns
36 | map_predict/grow          303 ns
37 | map_replace               177 ns
38 | map_fetch                 117 ns
39 | map_remove                192 ns
40 | memory used in map_grow    84.3956 Mbytes
41 | 
42 | DENSE_HASH_MAP:
43 | map_grow                   84 ns
44 | map_predict/grow           22 ns
45 | map_replace                18 ns
46 | map_fetch                  13 ns
47 | map_remove                 23 ns
48 | memory used in map_grow   256.0000 Mbytes
49 | 
50 | STANDARD HASH_MAP:
51 | map_grow                  162 ns
52 | map_predict/grow          107 ns
53 | map_replace                44 ns
54 | map_fetch                  22 ns
55 | map_remove                124 ns
56 | memory used in map_grow   204.1643 Mbytes
57 | 
58 | STANDARD MAP:
59 | map_grow                  297 ns
60 | map_predict/grow          282 ns
61 | map_replace               113 ns
62 | map_fetch                 113 ns
63 | map_remove                238 ns
64 | memory used in map_grow   236.8081 Mbytes
65 | 
66 | 67 | 68 |

A Note on Hash Functions

69 | 70 |

For good performance, the sparsehash hash routines depend on a good 71 | hash function: one that distributes data evenly. Many hashtable 72 | implementations come with sub-optimal hash functions that can degrade 73 | performance. For instance, the hash function given in Knuth's _Art of 74 | Computer Programming_, and the default string hash function in SGI's 75 | STL implementation, both distribute certain data sets unevenly, 76 | leading to poor performance.

77 | 78 |

As an example, in one test of the default SGI STL string hash 79 | function against the Hsieh hash function (see below), for a particular 80 | set of string keys, the Hsieh function resulted in hashtable lookups 81 | that were 20 times as fast as the STLPort hash function. The string 82 | keys were chosen to be "hard" to hash well, so these results may not 83 | be typical, but they are suggestive.

84 | 85 |

There has been much research over the years into good hash 86 | functions. Here are some hash functions of note.

87 | 88 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 36 4 | /svn/!svn/ver/106/trunk/experimental 5 | END 6 | libchash.h 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 47 10 | /svn/!svn/ver/106/trunk/experimental/libchash.h 11 | END 12 | example.c 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 46 16 | /svn/!svn/ver/106/trunk/experimental/example.c 17 | END 18 | README 19 | K 25 20 | svn:wc:ra_dav:version-url 21 | V 41 22 | /svn/!svn/ver/8/trunk/experimental/README 23 | END 24 | Makefile 25 | K 25 26 | svn:wc:ra_dav:version-url 27 | V 43 28 | /svn/!svn/ver/8/trunk/experimental/Makefile 29 | END 30 | libchash.c 31 | K 25 32 | svn:wc:ra_dav:version-url 33 | V 47 34 | /svn/!svn/ver/106/trunk/experimental/libchash.c 35 | END 36 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/experimental 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-01-31T23:50:02.386177Z 11 | 106 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | libchash.h 30 | file 31 | 32 | 33 | 34 | 35 | 2012-02-22T20:49:42.591761Z 36 | a89bc1e53ce02605ffeac5b4a88668bd 37 | 2012-01-31T23:50:02.386177Z 38 | 106 39 | csilvers 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 12423 62 | 63 | example.c 64 | file 65 | 66 | 67 | 68 | 69 | 2012-02-22T20:49:42.591761Z 70 | 5a51d3a6a14815482e13d93ef21c02be 71 | 2012-01-31T23:50:02.386177Z 72 | 106 73 | csilvers 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 1378 96 | 97 | README 98 | file 99 | 100 | 101 | 102 | 103 | 2012-02-22T20:49:42.591761Z 104 | 7a66f1080d79d95694b0b6d7b66f5617 105 | 2007-03-22T00:40:12.885450Z 106 | 8 107 | csilvers 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 685 130 | 131 | Makefile 132 | file 133 | 134 | 135 | 136 | 137 | 2012-02-22T20:49:42.591761Z 138 | dca812b35878b81f9b8b6e1686688aed 139 | 2007-03-22T00:40:12.885450Z 140 | 8 141 | csilvers 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 202 164 | 165 | libchash.c 166 | file 167 | 168 | 169 | 170 | 171 | 2012-02-22T20:49:42.591761Z 172 | 92d10df4280cc93b801c2994d399274e 173 | 2012-01-31T23:50:02.386177Z 174 | 106 175 | csilvers 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 66091 198 | 199 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/.svn/text-base/Makefile.svn-base: -------------------------------------------------------------------------------- 1 | example: example.o libchash.o 2 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ 3 | 4 | .SUFFIXES: .c .o .h 5 | .c.o: 6 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< 7 | 8 | example.o: example.c libchash.h 9 | libchash.o: libchash.c libchash.h 10 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/.svn/text-base/README.svn-base: -------------------------------------------------------------------------------- 1 | This is a C version of sparsehash (and also, maybe, densehash) that I 2 | wrote way back when, and served as the inspiration for the C++ 3 | version. The API for the C version is much uglier than the C++, 4 | because of the lack of template support. I believe the class works, 5 | but I'm not convinced it's really flexible or easy enough to use. 6 | 7 | It would be nice to rework this C class to follow the C++ API as 8 | closely as possible (eg have a set_deleted_key() instead of using a 9 | #define like this code does now). I believe the code compiles and 10 | runs, if anybody is interested in using it now, but it's subject to 11 | major change in the future, as people work on it. 12 | 13 | Craig Silverstein 14 | 20 March 2005 15 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/.svn/text-base/example.c.svn-base: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "libchash.h" 6 | 7 | static void TestInsert() { 8 | struct HashTable* ht; 9 | HTItem* bck; 10 | 11 | ht = AllocateHashTable(1, 0); /* value is 1 byte, 0: don't copy keys */ 12 | 13 | HashInsert(ht, PTR_KEY(ht, "January"), 31); /* 0: don't overwrite old val */ 14 | bck = HashInsert(ht, PTR_KEY(ht, "February"), 28); 15 | bck = HashInsert(ht, PTR_KEY(ht, "March"), 31); 16 | 17 | bck = HashFind(ht, PTR_KEY(ht, "February")); 18 | assert(bck); 19 | assert(bck->data == 28); 20 | 21 | FreeHashTable(ht); 22 | } 23 | 24 | static void TestFindOrInsert() { 25 | struct HashTable* ht; 26 | int i; 27 | int iterations = 1000000; 28 | int range = 30; /* random number between 1 and 30 */ 29 | 30 | ht = AllocateHashTable(4, 0); /* value is 4 bytes, 0: don't copy keys */ 31 | 32 | /* We'll test how good rand() is as a random number generator */ 33 | for (i = 0; i < iterations; ++i) { 34 | int key = rand() % range; 35 | HTItem* bck = HashFindOrInsert(ht, key, 0); /* initialize to 0 */ 36 | bck->data++; /* found one more of them */ 37 | } 38 | 39 | for (i = 0; i < range; ++i) { 40 | HTItem* bck = HashFind(ht, i); 41 | if (bck) { 42 | printf("%3d: %d\n", bck->key, bck->data); 43 | } else { 44 | printf("%3d: 0\n", i); 45 | } 46 | } 47 | 48 | FreeHashTable(ht); 49 | } 50 | 51 | int main(int argc, char** argv) { 52 | TestInsert(); 53 | TestFindOrInsert(); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/Makefile: -------------------------------------------------------------------------------- 1 | example: example.o libchash.o 2 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ 3 | 4 | .SUFFIXES: .c .o .h 5 | .c.o: 6 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< 7 | 8 | example.o: example.c libchash.h 9 | libchash.o: libchash.c libchash.h 10 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/README: -------------------------------------------------------------------------------- 1 | This is a C version of sparsehash (and also, maybe, densehash) that I 2 | wrote way back when, and served as the inspiration for the C++ 3 | version. The API for the C version is much uglier than the C++, 4 | because of the lack of template support. I believe the class works, 5 | but I'm not convinced it's really flexible or easy enough to use. 6 | 7 | It would be nice to rework this C class to follow the C++ API as 8 | closely as possible (eg have a set_deleted_key() instead of using a 9 | #define like this code does now). I believe the code compiles and 10 | runs, if anybody is interested in using it now, but it's subject to 11 | major change in the future, as people work on it. 12 | 13 | Craig Silverstein 14 | 20 March 2005 15 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/experimental/example.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "libchash.h" 6 | 7 | static void TestInsert() { 8 | struct HashTable* ht; 9 | HTItem* bck; 10 | 11 | ht = AllocateHashTable(1, 0); /* value is 1 byte, 0: don't copy keys */ 12 | 13 | HashInsert(ht, PTR_KEY(ht, "January"), 31); /* 0: don't overwrite old val */ 14 | bck = HashInsert(ht, PTR_KEY(ht, "February"), 28); 15 | bck = HashInsert(ht, PTR_KEY(ht, "March"), 31); 16 | 17 | bck = HashFind(ht, PTR_KEY(ht, "February")); 18 | assert(bck); 19 | assert(bck->data == 28); 20 | 21 | FreeHashTable(ht); 22 | } 23 | 24 | static void TestFindOrInsert() { 25 | struct HashTable* ht; 26 | int i; 27 | int iterations = 1000000; 28 | int range = 30; /* random number between 1 and 30 */ 29 | 30 | ht = AllocateHashTable(4, 0); /* value is 4 bytes, 0: don't copy keys */ 31 | 32 | /* We'll test how good rand() is as a random number generator */ 33 | for (i = 0; i < iterations; ++i) { 34 | int key = rand() % range; 35 | HTItem* bck = HashFindOrInsert(ht, key, 0); /* initialize to 0 */ 36 | bck->data++; /* found one more of them */ 37 | } 38 | 39 | for (i = 0; i < range; ++i) { 40 | HTItem* bck = HashFind(ht, i); 41 | if (bck) { 42 | printf("%3d: %d\n", bck->key, bck->data); 43 | } else { 44 | printf("%3d: 0\n", i); 45 | } 46 | } 47 | 48 | FreeHashTable(ht); 49 | } 50 | 51 | int main(int argc, char** argv) { 52 | TestInsert(); 53 | TestFindOrInsert(); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/m4/google_namespace.m4: -------------------------------------------------------------------------------- 1 | # Allow users to override the namespace we define our application's classes in 2 | # Arg $1 is the default namespace to use if --enable-namespace isn't present. 3 | 4 | # In general, $1 should be 'google', so we put all our exported symbols in a 5 | # unique namespace that is not likely to conflict with anyone else. However, 6 | # when it makes sense -- for instance, when publishing stl-like code -- you 7 | # may want to go with a different default, like 'std'. 8 | 9 | # We guarantee the invariant that GOOGLE_NAMESPACE starts with ::, 10 | # unless it's the empty string. Thus, it's always safe to do 11 | # GOOGLE_NAMESPACE::foo and be sure you're getting the foo that's 12 | # actually in the google namespace, and not some other namespace that 13 | # the namespace rules might kick in. 14 | 15 | AC_DEFUN([AC_DEFINE_GOOGLE_NAMESPACE], 16 | [google_namespace_default=[$1] 17 | AC_ARG_ENABLE(namespace, [ --enable-namespace=FOO to define these Google 18 | classes in the FOO namespace. --disable-namespace 19 | to define them in the global namespace. Default 20 | is to define them in namespace $1.], 21 | [case "$enableval" in 22 | yes) google_namespace="$google_namespace_default" ;; 23 | no) google_namespace="" ;; 24 | *) google_namespace="$enableval" ;; 25 | esac], 26 | [google_namespace="$google_namespace_default"]) 27 | if test -n "$google_namespace"; then 28 | ac_google_namespace="::$google_namespace" 29 | ac_google_start_namespace="namespace $google_namespace {" 30 | ac_google_end_namespace="}" 31 | else 32 | ac_google_namespace="" 33 | ac_google_start_namespace="" 34 | ac_google_end_namespace="" 35 | fi 36 | AC_DEFINE_UNQUOTED(GOOGLE_NAMESPACE, $ac_google_namespace, 37 | Namespace for Google classes) 38 | AC_DEFINE_UNQUOTED(_START_GOOGLE_NAMESPACE_, $ac_google_start_namespace, 39 | Puts following code inside the Google namespace) 40 | AC_DEFINE_UNQUOTED(_END_GOOGLE_NAMESPACE_, $ac_google_end_namespace, 41 | Stops putting the code inside the Google namespace) 42 | ]) 43 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/m4/namespaces.m4: -------------------------------------------------------------------------------- 1 | # Checks whether the compiler implements namespaces 2 | AC_DEFUN([AC_CXX_NAMESPACES], 3 | [AC_CACHE_CHECK(whether the compiler implements namespaces, 4 | ac_cv_cxx_namespaces, 5 | [AC_LANG_SAVE 6 | AC_LANG_CPLUSPLUS 7 | AC_TRY_COMPILE([namespace Outer { 8 | namespace Inner { int i = 0; }}], 9 | [using namespace Outer::Inner; return i;], 10 | ac_cv_cxx_namespaces=yes, 11 | ac_cv_cxx_namespaces=no) 12 | AC_LANG_RESTORE]) 13 | if test "$ac_cv_cxx_namespaces" = yes; then 14 | AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces]) 15 | fi]) 16 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/m4/stl_hash.m4: -------------------------------------------------------------------------------- 1 | # We check two things: where the include file is for 2 | # unordered_map/hash_map (we prefer the first form), and what 3 | # namespace unordered/hash_map lives in within that include file. We 4 | # include AC_TRY_COMPILE for all the combinations we've seen in the 5 | # wild. We define HASH_MAP_H to the location of the header file, and 6 | # HASH_NAMESPACE to the namespace the class (unordered_map or 7 | # hash_map) is in. We define HAVE_UNORDERED_MAP if the class we found 8 | # is named unordered_map, or leave it undefined if not. 9 | 10 | # This also checks if unordered map exists. 11 | AC_DEFUN([AC_CXX_STL_HASH], 12 | [AC_REQUIRE([AC_CXX_NAMESPACES]) 13 | AC_MSG_CHECKING(the location of hash_map) 14 | AC_LANG_SAVE 15 | AC_LANG_CPLUSPLUS 16 | ac_cv_cxx_hash_map="" 17 | # First try unordered_map, but not on gcc's before 4.2 -- I've 18 | # seen unexplainable unordered_map bugs with -O2 on older gcc's. 19 | AC_TRY_COMPILE([#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) 20 | # error GCC too old for unordered_map 21 | #endif 22 | ], 23 | [/* no program body necessary */], 24 | [stl_hash_old_gcc=no], 25 | [stl_hash_old_gcc=yes]) 26 | for location in unordered_map tr1/unordered_map; do 27 | for namespace in std std::tr1; do 28 | if test -z "$ac_cv_cxx_hash_map" -a "$stl_hash_old_gcc" != yes; then 29 | # Some older gcc's have a buggy tr1, so test a bit of code. 30 | AC_TRY_COMPILE([#include <$location>], 31 | [const ${namespace}::unordered_map t; 32 | return t.find(5) == t.end();], 33 | [ac_cv_cxx_hash_map="<$location>"; 34 | ac_cv_cxx_hash_namespace="$namespace"; 35 | ac_cv_cxx_have_unordered_map="yes";]) 36 | fi 37 | done 38 | done 39 | # Now try hash_map 40 | for location in ext/hash_map hash_map; do 41 | for namespace in __gnu_cxx "" std stdext; do 42 | if test -z "$ac_cv_cxx_hash_map"; then 43 | AC_TRY_COMPILE([#include <$location>], 44 | [${namespace}::hash_map t], 45 | [ac_cv_cxx_hash_map="<$location>"; 46 | ac_cv_cxx_hash_namespace="$namespace"; 47 | ac_cv_cxx_have_unordered_map="no";]) 48 | fi 49 | done 50 | done 51 | ac_cv_cxx_hash_set=`echo "$ac_cv_cxx_hash_map" | sed s/map/set/`; 52 | if test -n "$ac_cv_cxx_hash_map"; then 53 | AC_DEFINE(HAVE_HASH_MAP, 1, [define if the compiler has hash_map]) 54 | AC_DEFINE(HAVE_HASH_SET, 1, [define if the compiler has hash_set]) 55 | AC_DEFINE_UNQUOTED(HASH_MAP_H,$ac_cv_cxx_hash_map, 56 | [the location of or ]) 57 | AC_DEFINE_UNQUOTED(HASH_SET_H,$ac_cv_cxx_hash_set, 58 | [the location of or ]) 59 | AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace, 60 | [the namespace of hash_map/hash_set]) 61 | if test "$ac_cv_cxx_have_unordered_map" = yes; then 62 | AC_DEFINE(HAVE_UNORDERED_MAP,1, 63 | [define if the compiler supports unordered_{map,set}]) 64 | fi 65 | AC_MSG_RESULT([$ac_cv_cxx_hash_map]) 66 | else 67 | AC_MSG_RESULT() 68 | AC_MSG_WARN([could not find an STL hash_map]) 69 | fi 70 | ]) 71 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/m4/stl_hash_fun.m4: -------------------------------------------------------------------------------- 1 | # We just try to figure out where hash<> is defined. It's in some file 2 | # that ends in hash_fun.h... 3 | # 4 | # Ideally we'd use AC_CACHE_CHECK, but that only lets us store one value 5 | # at a time, and we need to store two (filename and namespace). 6 | # prints messages itself, so we have to do the message-printing ourselves 7 | # via AC_MSG_CHECKING + AC_MSG_RESULT. (TODO(csilvers): can we cache?) 8 | # 9 | # tr1/functional_hash.h: new gcc's with tr1 support 10 | # stl_hash_fun.h: old gcc's (gc2.95?) 11 | # ext/hash_fun.h: newer gcc's (gcc4) 12 | # stl/_hash_fun.h: STLport 13 | 14 | AC_DEFUN([AC_CXX_STL_HASH_FUN], 15 | [AC_REQUIRE([AC_CXX_STL_HASH]) 16 | AC_MSG_CHECKING(how to include hash_fun directly) 17 | AC_LANG_SAVE 18 | AC_LANG_CPLUSPLUS 19 | ac_cv_cxx_stl_hash_fun="" 20 | for location in functional tr1/functional \ 21 | ext/hash_fun.h ext/stl_hash_fun.h \ 22 | hash_fun.h stl_hash_fun.h \ 23 | stl/_hash_fun.h; do 24 | if test -z "$ac_cv_cxx_stl_hash_fun"; then 25 | AC_TRY_COMPILE([#include <$location>], 26 | [int x = ${ac_cv_cxx_hash_namespace}::hash()(5)], 27 | [ac_cv_cxx_stl_hash_fun="<$location>";]) 28 | fi 29 | done 30 | AC_LANG_RESTORE 31 | AC_DEFINE_UNQUOTED(HASH_FUN_H,$ac_cv_cxx_stl_hash_fun, 32 | [the location of the header defining hash functions]) 33 | AC_DEFINE_UNQUOTED(HASH_NAMESPACE,$ac_cv_cxx_hash_namespace, 34 | [the namespace of the hash<> function]) 35 | AC_MSG_RESULT([$ac_cv_cxx_stl_hash_fun]) 36 | ]) 37 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # This takes one commandline argument, the name of the package. If no 4 | # name is given, then we'll end up just using the name associated with 5 | # an arbitrary .tar.gz file in the rootdir. That's fine: there's probably 6 | # only one. 7 | # 8 | # Run this from the 'packages' directory, just under rootdir 9 | 10 | ## Set LIB to lib if exporting a library, empty-string else 11 | LIB= 12 | #LIB=lib 13 | 14 | PACKAGE="$1" 15 | VERSION="$2" 16 | 17 | # We can only build Debian packages, if the Debian build tools are installed 18 | if [ \! -x /usr/bin/debuild ]; then 19 | echo "Cannot find /usr/bin/debuild. Not building Debian packages." 1>&2 20 | exit 0 21 | fi 22 | 23 | # Double-check we're in the packages directory, just under rootdir 24 | if [ \! -r ../Makefile -a \! -r ../INSTALL ]; then 25 | echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 26 | echo "Also, you must run \"make dist\" before running this script." 1>&2 27 | exit 0 28 | fi 29 | 30 | # Find the top directory for this package 31 | topdir="${PWD%/*}" 32 | 33 | # Find the tar archive built by "make dist" 34 | archive="${PACKAGE}-${VERSION}" 35 | archive_with_underscore="${PACKAGE}_${VERSION}" 36 | if [ -z "${archive}" ]; then 37 | echo "Cannot find ../$PACKAGE*.tar.gz. Run \"make dist\" first." 1>&2 38 | exit 0 39 | fi 40 | 41 | # Create a pristine directory for building the Debian package files 42 | trap 'rm -rf '`pwd`/tmp'; exit $?' EXIT SIGHUP SIGINT SIGTERM 43 | 44 | rm -rf tmp 45 | mkdir -p tmp 46 | cd tmp 47 | 48 | # Debian has very specific requirements about the naming of build 49 | # directories, and tar archives. It also wants to write all generated 50 | # packages to the parent of the source directory. We accommodate these 51 | # requirements by building directly from the tar file. 52 | ln -s "${topdir}/${archive}.tar.gz" "${LIB}${archive}.orig.tar.gz" 53 | # Some version of debuilder want foo.orig.tar.gz with _ between versions. 54 | ln -s "${topdir}/${archive}.tar.gz" "${LIB}${archive_with_underscore}.orig.tar.gz" 55 | tar zfx "${LIB}${archive}.orig.tar.gz" 56 | [ -n "${LIB}" ] && mv "${archive}" "${LIB}${archive}" 57 | cd "${LIB}${archive}" 58 | # This is one of those 'specific requirements': where the deb control files live 59 | cp -a "packages/deb" "debian" 60 | 61 | # Now, we can call Debian's standard build tool 62 | debuild -uc -us 63 | cd ../.. # get back to the original top-level dir 64 | 65 | # We'll put the result in a subdirectory that's named after the OS version 66 | # we've made this .deb file for. 67 | destdir="debian-$(cat /etc/debian_version 2>/dev/null || echo UNKNOWN)" 68 | 69 | rm -rf "$destdir" 70 | mkdir -p "$destdir" 71 | mv $(find tmp -mindepth 1 -maxdepth 1 -type f) "$destdir" 72 | 73 | echo 74 | echo "The Debian package files are located in $PWD/$destdir" 75 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 36 4 | /svn/!svn/ver/113/trunk/packages/deb 5 | END 6 | control 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 44 10 | /svn/!svn/ver/106/trunk/packages/deb/control 11 | END 12 | sparsehash.dirs 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 52 16 | /svn/!svn/ver/106/trunk/packages/deb/sparsehash.dirs 17 | END 18 | compat 19 | K 25 20 | svn:wc:ra_dav:version-url 21 | V 41 22 | /svn/!svn/ver/6/trunk/packages/deb/compat 23 | END 24 | sparsehash.install 25 | K 25 26 | svn:wc:ra_dav:version-url 27 | V 55 28 | /svn/!svn/ver/106/trunk/packages/deb/sparsehash.install 29 | END 30 | changelog 31 | K 25 32 | svn:wc:ra_dav:version-url 33 | V 46 34 | /svn/!svn/ver/109/trunk/packages/deb/changelog 35 | END 36 | docs 37 | K 25 38 | svn:wc:ra_dav:version-url 39 | V 40 40 | /svn/!svn/ver/19/trunk/packages/deb/docs 41 | END 42 | copyright 43 | K 25 44 | svn:wc:ra_dav:version-url 45 | V 46 46 | /svn/!svn/ver/113/trunk/packages/deb/copyright 47 | END 48 | rules 49 | K 25 50 | svn:wc:ra_dav:version-url 51 | V 40 52 | /svn/!svn/ver/6/trunk/packages/deb/rules 53 | END 54 | README 55 | K 25 56 | svn:wc:ra_dav:version-url 57 | V 41 58 | /svn/!svn/ver/6/trunk/packages/deb/README 59 | END 60 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/packages/deb 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-02-02T22:46:54.449012Z 11 | 113 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | control 30 | file 31 | 32 | 33 | 34 | 35 | 2012-02-22T20:49:42.943762Z 36 | 8261546cb30188dd474c74916c161fcf 37 | 2012-01-31T23:50:02.386177Z 38 | 106 39 | csilvers 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 675 62 | 63 | sparsehash.dirs 64 | file 65 | 66 | 67 | 68 | 69 | 2012-02-22T20:49:42.943762Z 70 | 2dc533a8415133f45a5e803a1e28279c 71 | 2012-01-31T23:50:02.386177Z 72 | 106 73 | csilvers 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 80 96 | 97 | compat 98 | file 99 | 100 | 101 | 102 | 103 | 2012-02-22T20:49:42.943762Z 104 | 48a24b70a0b376535542b996af517398 105 | 2007-03-22T00:33:42.310464Z 106 | 6 107 | csilvers 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 2 130 | 131 | sparsehash.install 132 | file 133 | 134 | 135 | 136 | 137 | 2012-02-22T20:49:42.943762Z 138 | 533a0097660ac72db58ae7cc5fa7c8db 139 | 2012-01-31T23:50:02.386177Z 140 | 106 141 | csilvers 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 165 164 | 165 | changelog 166 | file 167 | 168 | 169 | 170 | 171 | 2012-02-22T20:49:42.943762Z 172 | 39bc6e17f8aa4f7c271aaedad10fe6f5 173 | 2012-02-01T03:10:59.454942Z 174 | 109 175 | donovanhide 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 4084 198 | 199 | docs 200 | file 201 | 202 | 203 | 204 | 205 | 2012-02-22T20:49:42.943762Z 206 | 5abf2a8d8096d2c61dd2f421405c2191 207 | 2007-06-11T19:35:30.179649Z 208 | 19 209 | csilvers 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 250 232 | 233 | copyright 234 | file 235 | 236 | 237 | 238 | 239 | 2012-02-22T20:49:42.943762Z 240 | b6ac709225eaeb679e3db6dbd4509b6e 241 | 2012-02-02T22:46:54.449012Z 242 | 113 243 | csilvers 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 1725 266 | 267 | rules 268 | file 269 | 270 | 271 | 272 | 273 | 2012-02-22T20:49:42.943762Z 274 | d4819f5489a5760835fcc7478acbf164 275 | 2007-03-22T00:33:42.310464Z 276 | 6 277 | csilvers 278 | has-props 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 2914 300 | 301 | README 302 | file 303 | 304 | 305 | 306 | 307 | 2012-02-22T20:49:42.943762Z 308 | d4c29fa922136ba5bb1a0129b80b369d 309 | 2007-03-22T00:33:42.310464Z 310 | 6 311 | csilvers 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 303 334 | 335 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/prop-base/rules.svn-base: -------------------------------------------------------------------------------- 1 | K 14 2 | svn:executable 3 | V 1 4 | * 5 | END 6 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/README.svn-base: -------------------------------------------------------------------------------- 1 | The list of files here isn't complete. For a step-by-step guide on 2 | how to set this package up correctly, check out 3 | http://www.debian.org/doc/maint-guide/ 4 | 5 | Most of the files that are in this directory are boilerplate. 6 | However, you may need to change the list of binary-arch dependencies 7 | in 'rules'. 8 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/changelog.svn-base: -------------------------------------------------------------------------------- 1 | sparsehash (2.0.1-1) unstable; urgency=low 2 | 3 | * New upstream release. 4 | 5 | -- Google Inc. and others Wed, 01 Feb 2012 02:57:48 +0000 6 | 7 | sparsehash (2.0-1) unstable; urgency=low 8 | 9 | * New upstream release. 10 | 11 | -- Google Inc. and others Tue, 31 Jan 2012 11:33:04 -0800 12 | 13 | sparsehash (1.12-1) unstable; urgency=low 14 | 15 | * New upstream release. 16 | 17 | -- Google Inc. Tue, 20 Dec 2011 21:04:04 -0800 18 | 19 | sparsehash (1.11-1) unstable; urgency=low 20 | 21 | * New upstream release. 22 | 23 | -- Google Inc. Thu, 23 Jun 2011 21:12:58 -0700 24 | 25 | sparsehash (1.10-1) unstable; urgency=low 26 | 27 | * New upstream release. 28 | 29 | -- Google Inc. Thu, 20 Jan 2011 16:07:39 -0800 30 | 31 | sparsehash (1.9-1) unstable; urgency=low 32 | 33 | * New upstream release. 34 | 35 | -- Google Inc. Fri, 24 Sep 2010 11:37:50 -0700 36 | 37 | sparsehash (1.8.1-1) unstable; urgency=low 38 | 39 | * New upstream release. 40 | 41 | -- Google Inc. Thu, 29 Jul 2010 15:01:29 -0700 42 | 43 | sparsehash (1.8-1) unstable; urgency=low 44 | 45 | * New upstream release. 46 | 47 | -- Google Inc. Thu, 29 Jul 2010 09:53:26 -0700 48 | 49 | sparsehash (1.7-1) unstable; urgency=low 50 | 51 | * New upstream release. 52 | 53 | -- Google Inc. Wed, 31 Mar 2010 12:32:03 -0700 54 | 55 | sparsehash (1.6-1) unstable; urgency=low 56 | 57 | * New upstream release. 58 | 59 | -- Google Inc. Fri, 08 Jan 2010 14:47:55 -0800 60 | 61 | sparsehash (1.5.2-1) unstable; urgency=low 62 | 63 | * New upstream release. 64 | 65 | -- Google Inc. Tue, 12 May 2009 14:16:38 -0700 66 | 67 | sparsehash (1.5.1-1) unstable; urgency=low 68 | 69 | * New upstream release. 70 | 71 | -- Google Inc. Fri, 08 May 2009 15:23:44 -0700 72 | 73 | sparsehash (1.5-1) unstable; urgency=low 74 | 75 | * New upstream release. 76 | 77 | -- Google Inc. Wed, 06 May 2009 11:28:49 -0700 78 | 79 | sparsehash (1.4-1) unstable; urgency=low 80 | 81 | * New upstream release. 82 | 83 | -- Google Inc. Wed, 28 Jan 2009 17:11:31 -0800 84 | 85 | sparsehash (1.3-1) unstable; urgency=low 86 | 87 | * New upstream release. 88 | 89 | -- Google Inc. Thu, 06 Nov 2008 15:06:09 -0800 90 | 91 | sparsehash (1.2-1) unstable; urgency=low 92 | 93 | * New upstream release. 94 | 95 | -- Google Inc. Thu, 18 Sep 2008 13:53:20 -0700 96 | 97 | sparsehash (1.1-1) unstable; urgency=low 98 | 99 | * New upstream release. 100 | 101 | -- Google Inc. Mon, 11 Feb 2008 16:30:11 -0800 102 | 103 | sparsehash (1.0-1) unstable; urgency=low 104 | 105 | * New upstream release. We are now out of beta. 106 | 107 | -- Google Inc. Tue, 13 Nov 2007 15:15:46 -0800 108 | 109 | sparsehash (0.9.1-1) unstable; urgency=low 110 | 111 | * New upstream release. 112 | 113 | -- Google Inc. Fri, 12 Oct 2007 12:35:24 -0700 114 | 115 | sparsehash (0.9-1) unstable; urgency=low 116 | 117 | * New upstream release. 118 | 119 | -- Google Inc. Tue, 09 Oct 2007 14:15:21 -0700 120 | 121 | sparsehash (0.8-1) unstable; urgency=low 122 | 123 | * New upstream release. 124 | 125 | -- Google Inc. Tue, 03 Jul 2007 12:55:04 -0700 126 | 127 | sparsehash (0.7-1) unstable; urgency=low 128 | 129 | * New upstream release. 130 | 131 | -- Google Inc. Mon, 11 Jun 2007 11:33:41 -0700 132 | 133 | sparsehash (0.6-1) unstable; urgency=low 134 | 135 | * New upstream release. 136 | 137 | -- Google Inc. Tue, 20 Mar 2007 17:29:34 -0700 138 | 139 | sparsehash (0.5-1) unstable; urgency=low 140 | 141 | * New upstream release. 142 | 143 | -- Google Inc. Sat, 21 Oct 2006 13:47:47 -0700 144 | 145 | sparsehash (0.4-1) unstable; urgency=low 146 | 147 | * New upstream release. 148 | 149 | -- Google Inc. Sun, 23 Apr 2006 22:42:35 -0700 150 | 151 | sparsehash (0.3-1) unstable; urgency=low 152 | 153 | * New upstream release. 154 | 155 | -- Google Inc. Thu, 03 Nov 2005 20:12:31 -0800 156 | 157 | sparsehash (0.2-1) unstable; urgency=low 158 | 159 | * New upstream release. 160 | 161 | -- Google Inc. Mon, 02 May 2005 07:04:46 -0700 162 | 163 | sparsehash (0.1-1) unstable; urgency=low 164 | 165 | * Initial release. 166 | 167 | -- Google Inc. Tue, 15 Feb 2005 07:17:02 -0800 168 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/compat.svn-base: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/control.svn-base: -------------------------------------------------------------------------------- 1 | Source: sparsehash 2 | Section: libdevel 3 | Priority: optional 4 | Maintainer: Google Inc. and others 5 | Build-Depends: debhelper (>= 4.0.0) 6 | Standards-Version: 3.6.1 7 | 8 | Package: sparsehash 9 | Section: libs 10 | Architecture: any 11 | Description: hash_map and hash_set classes with minimal space overhead 12 | This package contains several hash-map implementations, similar 13 | in API to SGI's hash_map class, but with different performance 14 | characteristics. sparse_hash_map uses very little space overhead: 1-2 15 | bits per entry. dense_hash_map is typically faster than the default 16 | SGI STL implementation. This package also includes hash-set analogues 17 | of these classes. 18 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/copyright.svn-base: -------------------------------------------------------------------------------- 1 | This package was debianized by Donovan Hide 2 | on Wed, 01 Feb 2012 02:57:48 +0000. 3 | 4 | It was downloaded from 5 | http://code.google.com/p/sparsehash/downloads/list 6 | 7 | Upstream Author: google-sparsehash@googlegroups.com 8 | 9 | Copyright (c) 2005, Google Inc. 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are 14 | met: 15 | 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the following disclaimer 20 | in the documentation and/or other materials provided with the 21 | distribution. 22 | * Neither the name of Google Inc. nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/docs.svn-base: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | COPYING 3 | ChangeLog 4 | INSTALL 5 | NEWS 6 | README 7 | TODO 8 | doc/dense_hash_map.html 9 | doc/dense_hash_set.html 10 | doc/sparse_hash_map.html 11 | doc/sparse_hash_set.html 12 | doc/sparsetable.html 13 | doc/implementation.html 14 | doc/performance.html 15 | doc/index.html 16 | doc/designstyle.css 17 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/rules.svn-base: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | # These are used for cross-compiling and for saving the configure script 14 | # from having to guess our platform (since we know it already) 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 17 | 18 | 19 | CFLAGS = -Wall -g 20 | 21 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 22 | CFLAGS += -O0 23 | else 24 | CFLAGS += -O2 25 | endif 26 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 27 | INSTALL_PROGRAM += -s 28 | endif 29 | 30 | # shared library versions, option 1 31 | #version=2.0.5 32 | #major=2 33 | # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so 34 | version=`ls src/.libs/lib*.so.* | \ 35 | awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` 36 | major=`ls src/.libs/lib*.so.* | \ 37 | awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` 38 | 39 | config.status: configure 40 | dh_testdir 41 | # Add here commands to configure the package. 42 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 43 | 44 | 45 | build: build-stamp 46 | build-stamp: config.status 47 | dh_testdir 48 | 49 | # Add here commands to compile the package. 50 | $(MAKE) 51 | 52 | touch build-stamp 53 | 54 | clean: 55 | dh_testdir 56 | dh_testroot 57 | rm -f build-stamp 58 | 59 | # Add here commands to clean up after the build process. 60 | -$(MAKE) distclean 61 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" 62 | cp -f /usr/share/misc/config.sub config.sub 63 | endif 64 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" 65 | cp -f /usr/share/misc/config.guess config.guess 66 | endif 67 | 68 | 69 | dh_clean 70 | 71 | install: build 72 | dh_testdir 73 | dh_testroot 74 | dh_clean -k 75 | dh_installdirs 76 | 77 | # Add here commands to install the package into debian/tmp 78 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp 79 | 80 | 81 | # Build architecture-independent files here. 82 | binary-indep: build install 83 | # We have nothing to do by default. 84 | 85 | # Build architecture-dependent files here. 86 | binary-arch: build install 87 | dh_testdir 88 | dh_testroot 89 | dh_installchangelogs ChangeLog 90 | dh_installdocs 91 | dh_installexamples 92 | dh_install --sourcedir=debian/tmp 93 | # dh_installmenu 94 | # dh_installdebconf 95 | # dh_installlogrotate 96 | # dh_installemacsen 97 | # dh_installpam 98 | # dh_installmime 99 | # dh_installinit 100 | # dh_installcron 101 | # dh_installinfo 102 | dh_installman 103 | dh_link 104 | dh_strip 105 | dh_compress 106 | dh_fixperms 107 | # dh_perl 108 | # dh_python 109 | dh_makeshlibs 110 | dh_installdeb 111 | dh_shlibdeps 112 | dh_gencontrol 113 | dh_md5sums 114 | dh_builddeb 115 | 116 | binary: binary-indep binary-arch 117 | .PHONY: build clean binary-indep binary-arch binary install 118 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/sparsehash.dirs.svn-base: -------------------------------------------------------------------------------- 1 | usr/include 2 | usr/include/google 3 | usr/include/sparsehash 4 | usr/lib 5 | usr/lib/pkgconfig 6 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/.svn/text-base/sparsehash.install.svn-base: -------------------------------------------------------------------------------- 1 | usr/include/google/* 2 | usr/include/sparsehash/* 3 | usr/lib/pkgconfig/* 4 | debian/tmp/usr/include/google/* 5 | debian/tmp/usr/include/sparsehash/* 6 | debian/tmp/usr/lib/pkgconfig/* 7 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/README: -------------------------------------------------------------------------------- 1 | The list of files here isn't complete. For a step-by-step guide on 2 | how to set this package up correctly, check out 3 | http://www.debian.org/doc/maint-guide/ 4 | 5 | Most of the files that are in this directory are boilerplate. 6 | However, you may need to change the list of binary-arch dependencies 7 | in 'rules'. 8 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/changelog: -------------------------------------------------------------------------------- 1 | sparsehash (2.0.2-1) unstable; urgency=low 2 | 3 | * New upstream release. 4 | 5 | -- Google Inc. and others Thu, 23 Feb 2012 23:47:18 +0000 6 | 7 | sparsehash (2.0.1-1) unstable; urgency=low 8 | 9 | * New upstream release. 10 | 11 | -- Google Inc. and others Wed, 01 Feb 2012 02:57:48 +0000 12 | 13 | sparsehash (2.0-1) unstable; urgency=low 14 | 15 | * New upstream release. 16 | 17 | -- Google Inc. and others Tue, 31 Jan 2012 11:33:04 -0800 18 | 19 | sparsehash (1.12-1) unstable; urgency=low 20 | 21 | * New upstream release. 22 | 23 | -- Google Inc. Tue, 20 Dec 2011 21:04:04 -0800 24 | 25 | sparsehash (1.11-1) unstable; urgency=low 26 | 27 | * New upstream release. 28 | 29 | -- Google Inc. Thu, 23 Jun 2011 21:12:58 -0700 30 | 31 | sparsehash (1.10-1) unstable; urgency=low 32 | 33 | * New upstream release. 34 | 35 | -- Google Inc. Thu, 20 Jan 2011 16:07:39 -0800 36 | 37 | sparsehash (1.9-1) unstable; urgency=low 38 | 39 | * New upstream release. 40 | 41 | -- Google Inc. Fri, 24 Sep 2010 11:37:50 -0700 42 | 43 | sparsehash (1.8.1-1) unstable; urgency=low 44 | 45 | * New upstream release. 46 | 47 | -- Google Inc. Thu, 29 Jul 2010 15:01:29 -0700 48 | 49 | sparsehash (1.8-1) unstable; urgency=low 50 | 51 | * New upstream release. 52 | 53 | -- Google Inc. Thu, 29 Jul 2010 09:53:26 -0700 54 | 55 | sparsehash (1.7-1) unstable; urgency=low 56 | 57 | * New upstream release. 58 | 59 | -- Google Inc. Wed, 31 Mar 2010 12:32:03 -0700 60 | 61 | sparsehash (1.6-1) unstable; urgency=low 62 | 63 | * New upstream release. 64 | 65 | -- Google Inc. Fri, 08 Jan 2010 14:47:55 -0800 66 | 67 | sparsehash (1.5.2-1) unstable; urgency=low 68 | 69 | * New upstream release. 70 | 71 | -- Google Inc. Tue, 12 May 2009 14:16:38 -0700 72 | 73 | sparsehash (1.5.1-1) unstable; urgency=low 74 | 75 | * New upstream release. 76 | 77 | -- Google Inc. Fri, 08 May 2009 15:23:44 -0700 78 | 79 | sparsehash (1.5-1) unstable; urgency=low 80 | 81 | * New upstream release. 82 | 83 | -- Google Inc. Wed, 06 May 2009 11:28:49 -0700 84 | 85 | sparsehash (1.4-1) unstable; urgency=low 86 | 87 | * New upstream release. 88 | 89 | -- Google Inc. Wed, 28 Jan 2009 17:11:31 -0800 90 | 91 | sparsehash (1.3-1) unstable; urgency=low 92 | 93 | * New upstream release. 94 | 95 | -- Google Inc. Thu, 06 Nov 2008 15:06:09 -0800 96 | 97 | sparsehash (1.2-1) unstable; urgency=low 98 | 99 | * New upstream release. 100 | 101 | -- Google Inc. Thu, 18 Sep 2008 13:53:20 -0700 102 | 103 | sparsehash (1.1-1) unstable; urgency=low 104 | 105 | * New upstream release. 106 | 107 | -- Google Inc. Mon, 11 Feb 2008 16:30:11 -0800 108 | 109 | sparsehash (1.0-1) unstable; urgency=low 110 | 111 | * New upstream release. We are now out of beta. 112 | 113 | -- Google Inc. Tue, 13 Nov 2007 15:15:46 -0800 114 | 115 | sparsehash (0.9.1-1) unstable; urgency=low 116 | 117 | * New upstream release. 118 | 119 | -- Google Inc. Fri, 12 Oct 2007 12:35:24 -0700 120 | 121 | sparsehash (0.9-1) unstable; urgency=low 122 | 123 | * New upstream release. 124 | 125 | -- Google Inc. Tue, 09 Oct 2007 14:15:21 -0700 126 | 127 | sparsehash (0.8-1) unstable; urgency=low 128 | 129 | * New upstream release. 130 | 131 | -- Google Inc. Tue, 03 Jul 2007 12:55:04 -0700 132 | 133 | sparsehash (0.7-1) unstable; urgency=low 134 | 135 | * New upstream release. 136 | 137 | -- Google Inc. Mon, 11 Jun 2007 11:33:41 -0700 138 | 139 | sparsehash (0.6-1) unstable; urgency=low 140 | 141 | * New upstream release. 142 | 143 | -- Google Inc. Tue, 20 Mar 2007 17:29:34 -0700 144 | 145 | sparsehash (0.5-1) unstable; urgency=low 146 | 147 | * New upstream release. 148 | 149 | -- Google Inc. Sat, 21 Oct 2006 13:47:47 -0700 150 | 151 | sparsehash (0.4-1) unstable; urgency=low 152 | 153 | * New upstream release. 154 | 155 | -- Google Inc. Sun, 23 Apr 2006 22:42:35 -0700 156 | 157 | sparsehash (0.3-1) unstable; urgency=low 158 | 159 | * New upstream release. 160 | 161 | -- Google Inc. Thu, 03 Nov 2005 20:12:31 -0800 162 | 163 | sparsehash (0.2-1) unstable; urgency=low 164 | 165 | * New upstream release. 166 | 167 | -- Google Inc. Mon, 02 May 2005 07:04:46 -0700 168 | 169 | sparsehash (0.1-1) unstable; urgency=low 170 | 171 | * Initial release. 172 | 173 | -- Google Inc. Tue, 15 Feb 2005 07:17:02 -0800 174 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/control: -------------------------------------------------------------------------------- 1 | Source: sparsehash 2 | Section: libdevel 3 | Priority: optional 4 | Maintainer: Google Inc. and others 5 | Build-Depends: debhelper (>= 4.0.0) 6 | Standards-Version: 3.6.1 7 | 8 | Package: sparsehash 9 | Section: libs 10 | Architecture: any 11 | Description: hash_map and hash_set classes with minimal space overhead 12 | This package contains several hash-map implementations, similar 13 | in API to SGI's hash_map class, but with different performance 14 | characteristics. sparse_hash_map uses very little space overhead: 1-2 15 | bits per entry. dense_hash_map is typically faster than the default 16 | SGI STL implementation. This package also includes hash-set analogues 17 | of these classes. 18 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Donovan Hide 2 | on Wed, Thu, 23 Feb 2012 23:47:18 +0000. 3 | 4 | It was downloaded from 5 | http://code.google.com/p/sparsehash/downloads/list 6 | 7 | Upstream Author: google-sparsehash@googlegroups.com 8 | 9 | Copyright (c) 2005, Google Inc. 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are 14 | met: 15 | 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above 19 | copyright notice, this list of conditions and the following disclaimer 20 | in the documentation and/or other materials provided with the 21 | distribution. 22 | * Neither the name of Google Inc. nor the names of its 23 | contributors may be used to endorse or promote products derived from 24 | this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/docs: -------------------------------------------------------------------------------- 1 | AUTHORS 2 | COPYING 3 | ChangeLog 4 | INSTALL 5 | NEWS 6 | README 7 | TODO 8 | doc/dense_hash_map.html 9 | doc/dense_hash_set.html 10 | doc/sparse_hash_map.html 11 | doc/sparse_hash_set.html 12 | doc/sparsetable.html 13 | doc/implementation.html 14 | doc/performance.html 15 | doc/index.html 16 | doc/designstyle.css 17 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | # These are used for cross-compiling and for saving the configure script 14 | # from having to guess our platform (since we know it already) 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 16 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 17 | 18 | 19 | CFLAGS = -Wall -g 20 | 21 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) 22 | CFLAGS += -O0 23 | else 24 | CFLAGS += -O2 25 | endif 26 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 27 | INSTALL_PROGRAM += -s 28 | endif 29 | 30 | # shared library versions, option 1 31 | #version=2.0.5 32 | #major=2 33 | # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so 34 | version=`ls src/.libs/lib*.so.* | \ 35 | awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` 36 | major=`ls src/.libs/lib*.so.* | \ 37 | awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` 38 | 39 | config.status: configure 40 | dh_testdir 41 | # Add here commands to configure the package. 42 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info 43 | 44 | 45 | build: build-stamp 46 | build-stamp: config.status 47 | dh_testdir 48 | 49 | # Add here commands to compile the package. 50 | $(MAKE) 51 | 52 | touch build-stamp 53 | 54 | clean: 55 | dh_testdir 56 | dh_testroot 57 | rm -f build-stamp 58 | 59 | # Add here commands to clean up after the build process. 60 | -$(MAKE) distclean 61 | ifneq "$(wildcard /usr/share/misc/config.sub)" "" 62 | cp -f /usr/share/misc/config.sub config.sub 63 | endif 64 | ifneq "$(wildcard /usr/share/misc/config.guess)" "" 65 | cp -f /usr/share/misc/config.guess config.guess 66 | endif 67 | 68 | 69 | dh_clean 70 | 71 | install: build 72 | dh_testdir 73 | dh_testroot 74 | dh_clean -k 75 | dh_installdirs 76 | 77 | # Add here commands to install the package into debian/tmp 78 | $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp 79 | 80 | 81 | # Build architecture-independent files here. 82 | binary-indep: build install 83 | # We have nothing to do by default. 84 | 85 | # Build architecture-dependent files here. 86 | binary-arch: build install 87 | dh_testdir 88 | dh_testroot 89 | dh_installchangelogs ChangeLog 90 | dh_installdocs 91 | dh_installexamples 92 | dh_install --sourcedir=debian/tmp 93 | # dh_installmenu 94 | # dh_installdebconf 95 | # dh_installlogrotate 96 | # dh_installemacsen 97 | # dh_installpam 98 | # dh_installmime 99 | # dh_installinit 100 | # dh_installcron 101 | # dh_installinfo 102 | dh_installman 103 | dh_link 104 | dh_strip 105 | dh_compress 106 | dh_fixperms 107 | # dh_perl 108 | # dh_python 109 | dh_makeshlibs 110 | dh_installdeb 111 | dh_shlibdeps 112 | dh_gencontrol 113 | dh_md5sums 114 | dh_builddeb 115 | 116 | binary: binary-indep binary-arch 117 | .PHONY: build clean binary-indep binary-arch binary install 118 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/sparsehash.dirs: -------------------------------------------------------------------------------- 1 | usr/include 2 | usr/include/google 3 | usr/include/sparsehash 4 | usr/lib 5 | usr/lib/pkgconfig 6 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/deb/sparsehash.install: -------------------------------------------------------------------------------- 1 | usr/include/google/* 2 | usr/include/sparsehash/* 3 | usr/lib/pkgconfig/* 4 | debian/tmp/usr/include/google/* 5 | debian/tmp/usr/include/sparsehash/* 6 | debian/tmp/usr/lib/pkgconfig/* 7 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/rpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Run this from the 'packages' directory, just under rootdir 4 | 5 | # We can only build rpm packages, if the rpm build tools are installed 6 | if [ \! -x /usr/bin/rpmbuild ] 7 | then 8 | echo "Cannot find /usr/bin/rpmbuild. Not building an rpm." 1>&2 9 | exit 0 10 | fi 11 | 12 | # Check the commandline flags 13 | PACKAGE="$1" 14 | VERSION="$2" 15 | fullname="${PACKAGE}-${VERSION}" 16 | archive=../$fullname.tar.gz 17 | 18 | if [ -z "$1" -o -z "$2" ] 19 | then 20 | echo "Usage: $0 " 1>&2 21 | exit 0 22 | fi 23 | 24 | # Double-check we're in the packages directory, just under rootdir 25 | if [ \! -r ../Makefile -a \! -r ../INSTALL ] 26 | then 27 | echo "Must run $0 in the 'packages' directory, under the root directory." 1>&2 28 | echo "Also, you must run \"make dist\" before running this script." 1>&2 29 | exit 0 30 | fi 31 | 32 | if [ \! -r "$archive" ] 33 | then 34 | echo "Cannot find $archive. Run \"make dist\" first." 1>&2 35 | exit 0 36 | fi 37 | 38 | # Create the directory where the input lives, and where the output should live 39 | RPM_SOURCE_DIR="/tmp/rpmsource-$fullname" 40 | RPM_BUILD_DIR="/tmp/rpmbuild-$fullname" 41 | 42 | trap 'rm -rf $RPM_SOURCE_DIR $RPM_BUILD_DIR; exit $?' EXIT SIGHUP SIGINT SIGTERM 43 | 44 | rm -rf "$RPM_SOURCE_DIR" "$RPM_BUILD_DIR" 45 | mkdir "$RPM_SOURCE_DIR" 46 | mkdir "$RPM_BUILD_DIR" 47 | 48 | cp "$archive" "$RPM_SOURCE_DIR" 49 | 50 | # rpmbuild -- as far as I can tell -- asks the OS what CPU it has. 51 | # This may differ from what kind of binaries gcc produces. dpkg 52 | # does a better job of this, so if we can run 'dpkg --print-architecture' 53 | # to get the build CPU, we use that in preference of the rpmbuild 54 | # default. 55 | target=`dpkg --print-architecture 2>/dev/null || echo ""` 56 | if [ -n "$target" ] 57 | then 58 | target=" --target $target" 59 | fi 60 | 61 | rpmbuild -bb rpm/rpm.spec $target \ 62 | --define "NAME $PACKAGE" \ 63 | --define "VERSION $VERSION" \ 64 | --define "_sourcedir $RPM_SOURCE_DIR" \ 65 | --define "_builddir $RPM_BUILD_DIR" \ 66 | --define "_rpmdir $RPM_SOURCE_DIR" 67 | 68 | # We put the output in a directory based on what system we've built for 69 | destdir=rpm-unknown 70 | if [ -r /etc/issue ] 71 | then 72 | grep "Red Hat.*release 7" /etc/issue >/dev/null 2>&1 && destdir=rh7 73 | grep "Red Hat.*release 8" /etc/issue >/dev/null 2>&1 && destdir=rh8 74 | grep "Red Hat.*release 9" /etc/issue >/dev/null 2>&1 && destdir=rh9 75 | grep "Fedora Core.*release 1" /etc/issue >/dev/null 2>&1 && destdir=fc1 76 | grep "Fedora Core.*release 2" /etc/issue >/dev/null 2>&1 && destdir=fc2 77 | grep "Fedora Core.*release 3" /etc/issue >/dev/null 2>&1 && destdir=fc3 78 | fi 79 | 80 | rm -rf "$destdir" 81 | mkdir -p "$destdir" 82 | # We want to get not only the main package but devel etc, hence the middle * 83 | mv "$RPM_SOURCE_DIR"/*/"${PACKAGE}"-*"${VERSION}"*.rpm "$destdir" 84 | 85 | echo 86 | echo "The rpm package file(s) are located in $PWD/$destdir" 87 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/packages/rpm/rpm.spec: -------------------------------------------------------------------------------- 1 | %define RELEASE 1 2 | %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} 3 | %define prefix /usr 4 | 5 | Name: %NAME 6 | Summary: hash_map and hash_set classes with minimal space overhead 7 | Version: %VERSION 8 | Release: %rel 9 | Group: Development/Libraries 10 | URL: http://code.google.com/p/sparsehash 11 | License: BSD 12 | Vendor: Google Inc. and others 13 | Packager: Google Inc. and others 14 | Source: http://%{NAME}.googlecode.com/files/%{NAME}-%{VERSION}.tar.gz 15 | Distribution: Redhat 7 and above. 16 | Buildroot: %{_tmppath}/%{name}-root 17 | Prefix: %prefix 18 | Buildarch: noarch 19 | 20 | %description 21 | The %name package contains several hash-map implementations, similar 22 | in API to the SGI hash_map class, but with different performance 23 | characteristics. sparse_hash_map uses very little space overhead: 1-2 24 | bits per entry. dense_hash_map is typically faster than the default 25 | SGI STL implementation. This package also includes hash-set analogues 26 | of these classes. 27 | 28 | %changelog 29 | * Wed Apr 22 2009 30 | - Change build rule to use %configure instead of ./configure 31 | - Change install to use DESTDIR instead of prefix for make install 32 | - Use wildcards for doc/ and lib/ directories 33 | - Use {_includedir} instead of {prefix}/include 34 | 35 | * Fri Jan 14 2005 36 | - First draft 37 | 38 | %prep 39 | %setup 40 | 41 | %build 42 | # I can't use '% configure', because it defines -m32 which breaks on 43 | # my development environment for some reason. But I do take 44 | # as much from % configure (in /usr/lib/rpm/macros) as I can. 45 | ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} 46 | make 47 | 48 | %install 49 | rm -rf $RPM_BUILD_ROOT 50 | make DESTDIR=$RPM_BUILD_ROOT install 51 | 52 | %clean 53 | rm -rf $RPM_BUILD_ROOT 54 | 55 | %files 56 | %defattr(-,root,root) 57 | 58 | %docdir %{prefix}/share/doc/%{NAME}-%{VERSION} 59 | %{prefix}/share/doc/%{NAME}-%{VERSION}/* 60 | 61 | %{_includedir}/google 62 | %{_includedir}/sparsehash 63 | %{_libdir}/pkgconfig/*.pc 64 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/sparsehash.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "type_traits_unittest", "vsprojects\type_traits_unittest\type_traits_unittest.vcproj", "{008CCFED-7D7B-46F8-8E13-03837A2258B3}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sparsetable_unittest", "vsprojects\sparsetable_unittest\sparsetable_unittest.vcproj", "{E420867B-8BFA-4739-99EC-E008AB762FF9}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hashtable_test", "vsprojects\hashtable_test\hashtable_test.vcproj", "{FCDB3718-F01C-4DE4-B9F5-E10F2C5C0535}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_test", "vsprojects\simple_test\simple_test.vcproj", "{FCDB3718-F01C-4DE4-B9F5-E10F2C5C0538}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libc_allocator_with_realloc_test", "vsprojects\libc_allocator_with_realloc_test\libc_allocator_with_realloc_test.vcproj", "{FCDB3718-F01C-4DE4-B9F5-E10F2C5C0539}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | EndProjectSection 21 | EndProject 22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_hash_map", "vsprojects\time_hash_map\time_hash_map.vcproj", "{A74E5DB8-5295-487A-AB1D-23859F536F45}" 23 | ProjectSection(ProjectDependencies) = postProject 24 | EndProjectSection 25 | EndProject 26 | Global 27 | GlobalSection(SolutionConfiguration) = preSolution 28 | Debug = Debug 29 | Release = Release 30 | EndGlobalSection 31 | GlobalSection(ProjectDependencies) = postSolution 32 | EndGlobalSection 33 | GlobalSection(ProjectConfiguration) = postSolution 34 | {008CCFED-7D7B-46F8-8E13-03837A2258B3}.Debug.ActiveCfg = Debug|Win32 35 | {008CCFED-7D7B-46F8-8E13-03837A2258B3}.Debug.Build.0 = Debug|Win32 36 | {008CCFED-7D7B-46F8-8E13-03837A2258B3}.Release.ActiveCfg = Release|Win32 37 | {008CCFED-7D7B-46F8-8E13-03837A2258B3}.Release.Build.0 = Release|Win32 38 | {E420867B-8BFA-4739-99EC-E008AB762FF9}.Debug.ActiveCfg = Debug|Win32 39 | {E420867B-8BFA-4739-99EC-E008AB762FF9}.Debug.Build.0 = Debug|Win32 40 | {E420867B-8BFA-4739-99EC-E008AB762FF9}.Release.ActiveCfg = Release|Win32 41 | {E420867B-8BFA-4739-99EC-E008AB762FF9}.Release.Build.0 = Release|Win32 42 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0535}.Debug.ActiveCfg = Debug|Win32 43 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0535}.Debug.Build.0 = Debug|Win32 44 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0535}.Release.ActiveCfg = Release|Win32 45 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0535}.Release.Build.0 = Release|Win32 46 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0538}.Debug.ActiveCfg = Debug|Win32 47 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0538}.Debug.Build.0 = Debug|Win32 48 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0538}.Release.ActiveCfg = Release|Win32 49 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0538}.Release.Build.0 = Release|Win32 50 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0539}.Debug.ActiveCfg = Debug|Win32 51 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0539}.Debug.Build.0 = Debug|Win32 52 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0539}.Release.ActiveCfg = Release|Win32 53 | {FCDB3718-F01C-4DE4-B9F5-E10F2C5C0539}.Release.Build.0 = Release|Win32 54 | {A74E5DB8-5295-487A-AB1D-23859F536F45}.Debug.ActiveCfg = Debug|Win32 55 | {A74E5DB8-5295-487A-AB1D-23859F536F45}.Debug.Build.0 = Debug|Win32 56 | {A74E5DB8-5295-487A-AB1D-23859F536F45}.Release.ActiveCfg = Release|Win32 57 | {A74E5DB8-5295-487A-AB1D-23859F536F45}.Release.Build.0 = Release|Win32 58 | EndGlobalSection 59 | GlobalSection(ExtensibilityGlobals) = postSolution 60 | EndGlobalSection 61 | GlobalSection(ExtensibilityAddIns) = postSolution 62 | EndGlobalSection 63 | EndGlobal 64 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/config.h.in: -------------------------------------------------------------------------------- 1 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Namespace for Google classes */ 4 | #undef GOOGLE_NAMESPACE 5 | 6 | /* the location of the header defining hash functions */ 7 | #undef HASH_FUN_H 8 | 9 | /* the location of or */ 10 | #undef HASH_MAP_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #undef HASH_NAMESPACE 14 | 15 | /* the location of or */ 16 | #undef HASH_SET_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_GOOGLE_MALLOC_EXTENSION_H 20 | 21 | /* define if the compiler has hash_map */ 22 | #undef HAVE_HASH_MAP 23 | 24 | /* define if the compiler has hash_set */ 25 | #undef HAVE_HASH_SET 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_INTTYPES_H 29 | 30 | /* Define to 1 if the system has the type `long long'. */ 31 | #undef HAVE_LONG_LONG 32 | 33 | /* Define to 1 if you have the `memcpy' function. */ 34 | #undef HAVE_MEMCPY 35 | 36 | /* Define to 1 if you have the `memmove' function. */ 37 | #undef HAVE_MEMMOVE 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_MEMORY_H 41 | 42 | /* define if the compiler implements namespaces */ 43 | #undef HAVE_NAMESPACES 44 | 45 | /* Define if you have POSIX threads libraries and header files. */ 46 | #undef HAVE_PTHREAD 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_STDINT_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_STDLIB_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_STRINGS_H 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_STRING_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_SYS_RESOURCE_H 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_SYS_STAT_H 65 | 66 | /* Define to 1 if you have the header file. */ 67 | #undef HAVE_SYS_TIME_H 68 | 69 | /* Define to 1 if you have the header file. */ 70 | #undef HAVE_SYS_TYPES_H 71 | 72 | /* Define to 1 if you have the header file. */ 73 | #undef HAVE_SYS_UTSNAME_H 74 | 75 | /* Define to 1 if the system has the type `uint16_t'. */ 76 | #undef HAVE_UINT16_T 77 | 78 | /* Define to 1 if you have the header file. */ 79 | #undef HAVE_UNISTD_H 80 | 81 | /* define if the compiler supports unordered_{map,set} */ 82 | #undef HAVE_UNORDERED_MAP 83 | 84 | /* Define to 1 if the system has the type `u_int16_t'. */ 85 | #undef HAVE_U_INT16_T 86 | 87 | /* Define to 1 if the system has the type `__uint16'. */ 88 | #undef HAVE___UINT16 89 | 90 | /* Name of package */ 91 | #undef PACKAGE 92 | 93 | /* Define to the address where bug reports for this package should be sent. */ 94 | #undef PACKAGE_BUGREPORT 95 | 96 | /* Define to the full name of this package. */ 97 | #undef PACKAGE_NAME 98 | 99 | /* Define to the full name and version of this package. */ 100 | #undef PACKAGE_STRING 101 | 102 | /* Define to the one symbol short name of this package. */ 103 | #undef PACKAGE_TARNAME 104 | 105 | /* Define to the home page for this package. */ 106 | #undef PACKAGE_URL 107 | 108 | /* Define to the version of this package. */ 109 | #undef PACKAGE_VERSION 110 | 111 | /* Define to necessary symbol if this constant uses a non-standard name on 112 | your system. */ 113 | #undef PTHREAD_CREATE_JOINABLE 114 | 115 | /* The system-provided hash function including the namespace. */ 116 | #undef SPARSEHASH_HASH 117 | 118 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 119 | #undef SPARSEHASH_HASH_NO_NAMESPACE 120 | 121 | /* Define to 1 if you have the ANSI C header files. */ 122 | #undef STDC_HEADERS 123 | 124 | /* Version number of package */ 125 | #undef VERSION 126 | 127 | /* Stops putting the code inside the Google namespace */ 128 | #undef _END_GOOGLE_NAMESPACE_ 129 | 130 | /* Puts following code inside the Google namespace */ 131 | #undef _START_GOOGLE_NAMESPACE_ 132 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/config.h.include: -------------------------------------------------------------------------------- 1 | /*** 2 | *** These are #defines that autoheader puts in config.h.in that we 3 | *** want to show up in sparseconfig.h, the minimal config.h file 4 | *** #included by all our .h files. The reason we don't take 5 | *** everything that autoheader emits is that we have to include a 6 | *** config.h in installed header files, and we want to minimize the 7 | *** number of #defines we make so as to not pollute the namespace. 8 | ***/ 9 | GOOGLE_NAMESPACE 10 | HASH_NAMESPACE 11 | HASH_FUN_H 12 | SPARSEHASH_HASH 13 | HAVE_UINT16_T 14 | HAVE_U_INT16_T 15 | HAVE___UINT16 16 | HAVE_LONG_LONG 17 | HAVE_SYS_TYPES_H 18 | HAVE_STDINT_H 19 | HAVE_INTTYPES_H 20 | HAVE_MEMCPY 21 | _END_GOOGLE_NAMESPACE_ 22 | _START_GOOGLE_NAMESPACE_ 23 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/dense_hash_map: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/dense_hash_set: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparse_hash_map: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparse_hash_set: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparsehash/densehashtable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparsehash/hashtable-common.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparsehash/libc_allocator_with_realloc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparsehash/sparsehashtable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/sparsetable: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/template_util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/google/type_traits.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Header files have moved from the google directory to the sparsehash 31 | // directory. This forwarding file is provided only for backwards 32 | // compatibility. Use in all new code. 33 | 34 | #include 35 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/libc_allocator_with_realloc_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include "testutil.h" 40 | 41 | using std::cerr; 42 | using std::cout; 43 | using std::string; 44 | using std::basic_string; 45 | using std::char_traits; 46 | using std::vector; 47 | using GOOGLE_NAMESPACE::libc_allocator_with_realloc; 48 | 49 | #define arraysize(a) ( sizeof(a) / sizeof(*(a)) ) 50 | 51 | namespace { 52 | 53 | typedef libc_allocator_with_realloc int_alloc; 54 | typedef int_alloc::rebind::other intp_alloc; 55 | 56 | // cstring allocates from libc_allocator_with_realloc. 57 | typedef basic_string, 58 | libc_allocator_with_realloc > cstring; 59 | typedef vector > cstring_vector; 60 | 61 | TEST(LibcAllocatorWithReallocTest, Allocate) { 62 | int_alloc alloc; 63 | intp_alloc palloc; 64 | 65 | int** parray = palloc.allocate(1024); 66 | for (int i = 0; i < 16; ++i) { 67 | parray[i] = alloc.allocate(i * 1024 + 1); 68 | } 69 | for (int i = 0; i < 16; ++i) { 70 | alloc.deallocate(parray[i], i * 1024 + 1); 71 | } 72 | palloc.deallocate(parray, 1024); 73 | 74 | int* p = alloc.allocate(4096); 75 | p[0] = 1; 76 | p[1023] = 2; 77 | p[4095] = 3; 78 | p = alloc.reallocate(p, 8192); 79 | EXPECT_EQ(1, p[0]); 80 | EXPECT_EQ(2, p[1023]); 81 | EXPECT_EQ(3, p[4095]); 82 | p = alloc.reallocate(p, 1024); 83 | EXPECT_EQ(1, p[0]); 84 | EXPECT_EQ(2, p[1023]); 85 | alloc.deallocate(p, 1024); 86 | } 87 | 88 | TEST(LibcAllocatorWithReallocTest, TestSTL) { 89 | // Test strings copied from base/arena_unittest.cc 90 | static const char* test_strings[] = { 91 | "aback", "abaft", "abandon", "abandoned", "abandoning", 92 | "abandonment", "abandons", "abase", "abased", "abasement", 93 | "abasements", "abases", "abash", "abashed", "abashes", "abashing", 94 | "abasing", "abate", "abated", "abatement", "abatements", "abater", 95 | "abates", "abating", "abbe", "abbey", "abbeys", "abbot", "abbots", 96 | "abbreviate", "abbreviated", "abbreviates", "abbreviating", 97 | "abbreviation", "abbreviations", "abdomen", "abdomens", "abdominal", 98 | "abduct", "abducted", "abduction", "abductions", "abductor", "abductors", 99 | "abducts", "Abe", "abed", "Abel", "Abelian", "Abelson", "Aberdeen", 100 | "Abernathy", "aberrant", "aberration", "aberrations", "abet", "abets", 101 | "abetted", "abetter", "abetting", "abeyance", "abhor", "abhorred", 102 | "abhorrent", "abhorrer", "abhorring", "abhors", "abide", "abided", 103 | "abides", "abiding"}; 104 | cstring_vector v; 105 | for (size_t i = 0; i < arraysize(test_strings); ++i) { 106 | v.push_back(test_strings[i]); 107 | } 108 | for (size_t i = arraysize(test_strings); i > 0; --i) { 109 | EXPECT_EQ(cstring(test_strings[i-1]), v.back()); 110 | v.pop_back(); 111 | } 112 | } 113 | 114 | } // namespace 115 | 116 | int main(int, char **) { 117 | // All the work is done in the static constructors. If they don't 118 | // die, the tests have all passed. 119 | cout << "PASS\n"; 120 | return 0; 121 | } 122 | 123 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/simple_compat_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // 32 | // This tests mostly that we can #include the files correctly 33 | // and have them work. It is like simple_test.cc but uses the 34 | // compatibility #include directory (google/) rather than the 35 | // canonical one (sparsehash/). This unittest purposefully does 36 | // not #include ; it's meant to emulate what a 'regular 37 | // install' of sparsehash would be able to see. 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #define CHECK_IFF(cond, when) do { \ 48 | if (when) { \ 49 | if (!(cond)) { \ 50 | puts("ERROR: " #cond " failed when " #when " is true\n"); \ 51 | exit(1); \ 52 | } \ 53 | } else { \ 54 | if (cond) { \ 55 | puts("ERROR: " #cond " succeeded when " #when " is false\n"); \ 56 | exit(1); \ 57 | } \ 58 | } \ 59 | } while (0) 60 | 61 | int main(int argc, char**) { 62 | // Run with an argument to get verbose output 63 | const bool verbose = argc > 1; 64 | 65 | google::sparse_hash_set sset; 66 | google::sparse_hash_map smap; 67 | google::dense_hash_set dset; 68 | google::dense_hash_map dmap; 69 | dset.set_empty_key(-1); 70 | dmap.set_empty_key(-1); 71 | 72 | for (int i = 0; i < 100; i += 10) { // go by tens 73 | sset.insert(i); 74 | smap[i] = i+1; 75 | dset.insert(i + 5); 76 | dmap[i+5] = i+6; 77 | } 78 | 79 | if (verbose) { 80 | for (google::sparse_hash_set::const_iterator it = sset.begin(); 81 | it != sset.end(); ++it) 82 | printf("sset: %d\n", *it); 83 | for (google::sparse_hash_map::const_iterator it = smap.begin(); 84 | it != smap.end(); ++it) 85 | printf("smap: %d -> %d\n", it->first, it->second); 86 | for (google::dense_hash_set::const_iterator it = dset.begin(); 87 | it != dset.end(); ++it) 88 | printf("dset: %d\n", *it); 89 | for (google::dense_hash_map::const_iterator it = dmap.begin(); 90 | it != dmap.end(); ++it) 91 | printf("dmap: %d -> %d\n", it->first, it->second); 92 | } 93 | 94 | for (int i = 0; i < 100; i++) { 95 | CHECK_IFF(sset.find(i) != sset.end(), (i % 10) == 0); 96 | CHECK_IFF(smap.find(i) != smap.end(), (i % 10) == 0); 97 | CHECK_IFF(smap.find(i) != smap.end() && smap.find(i)->second == i+1, 98 | (i % 10) == 0); 99 | CHECK_IFF(dset.find(i) != dset.end(), (i % 10) == 5); 100 | CHECK_IFF(dmap.find(i) != dmap.end(), (i % 10) == 5); 101 | CHECK_IFF(dmap.find(i) != dmap.end() && dmap.find(i)->second == i+1, 102 | (i % 10) == 5); 103 | } 104 | printf("PASS\n"); 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/simple_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2007, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | // 32 | // This tests mostly that we can #include the files correctly 33 | // and have them work. This unittest purposefully does not 34 | // #include ; it's meant to emulate what a 'regular 35 | // install' of sparsehash would be able to see. 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #define CHECK_IFF(cond, when) do { \ 48 | if (when) { \ 49 | if (!(cond)) { \ 50 | puts("ERROR: " #cond " failed when " #when " is true\n"); \ 51 | exit(1); \ 52 | } \ 53 | } else { \ 54 | if (cond) { \ 55 | puts("ERROR: " #cond " succeeded when " #when " is false\n"); \ 56 | exit(1); \ 57 | } \ 58 | } \ 59 | } while (0) 60 | 61 | int main(int argc, char**) { 62 | // Run with an argument to get verbose output 63 | const bool verbose = argc > 1; 64 | 65 | google::sparse_hash_set sset; 66 | google::sparse_hash_map smap; 67 | google::dense_hash_set dset; 68 | google::dense_hash_map dmap; 69 | dset.set_empty_key(-1); 70 | dmap.set_empty_key(-1); 71 | 72 | for (int i = 0; i < 100; i += 10) { // go by tens 73 | sset.insert(i); 74 | smap[i] = i+1; 75 | dset.insert(i + 5); 76 | dmap[i+5] = i+6; 77 | } 78 | 79 | if (verbose) { 80 | for (google::sparse_hash_set::const_iterator it = sset.begin(); 81 | it != sset.end(); ++it) 82 | printf("sset: %d\n", *it); 83 | for (google::sparse_hash_map::const_iterator it = smap.begin(); 84 | it != smap.end(); ++it) 85 | printf("smap: %d -> %d\n", it->first, it->second); 86 | for (google::dense_hash_set::const_iterator it = dset.begin(); 87 | it != dset.end(); ++it) 88 | printf("dset: %d\n", *it); 89 | for (google::dense_hash_map::const_iterator it = dmap.begin(); 90 | it != dmap.end(); ++it) 91 | printf("dmap: %d -> %d\n", it->first, it->second); 92 | } 93 | 94 | for (int i = 0; i < 100; i++) { 95 | CHECK_IFF(sset.find(i) != sset.end(), (i % 10) == 0); 96 | CHECK_IFF(smap.find(i) != smap.end(), (i % 10) == 0); 97 | CHECK_IFF(smap.find(i) != smap.end() && smap.find(i)->second == i+1, 98 | (i % 10) == 0); 99 | CHECK_IFF(dset.find(i) != dset.end(), (i % 10) == 5); 100 | CHECK_IFF(dmap.find(i) != dmap.end(), (i % 10) == 5); 101 | CHECK_IFF(dmap.find(i) != dmap.end() && dmap.find(i)->second == i+1, 102 | (i % 10) == 5); 103 | } 104 | printf("PASS\n"); 105 | return 0; 106 | } 107 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/sparsehash/internal/libc_allocator_with_realloc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // --- 31 | 32 | #ifndef UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_ 33 | #define UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_ 34 | 35 | #include 36 | #include // for malloc/realloc/free 37 | #include // for ptrdiff_t 38 | #include // for placement new 39 | 40 | _START_GOOGLE_NAMESPACE_ 41 | 42 | template 43 | class libc_allocator_with_realloc { 44 | public: 45 | typedef T value_type; 46 | typedef size_t size_type; 47 | typedef ptrdiff_t difference_type; 48 | 49 | typedef T* pointer; 50 | typedef const T* const_pointer; 51 | typedef T& reference; 52 | typedef const T& const_reference; 53 | 54 | libc_allocator_with_realloc() {} 55 | libc_allocator_with_realloc(const libc_allocator_with_realloc&) {} 56 | ~libc_allocator_with_realloc() {} 57 | 58 | pointer address(reference r) const { return &r; } 59 | const_pointer address(const_reference r) const { return &r; } 60 | 61 | pointer allocate(size_type n, const_pointer = 0) { 62 | return static_cast(malloc(n * sizeof(value_type))); 63 | } 64 | void deallocate(pointer p, size_type) { 65 | free(p); 66 | } 67 | pointer reallocate(pointer p, size_type n) { 68 | return static_cast(realloc(p, n * sizeof(value_type))); 69 | } 70 | 71 | size_type max_size() const { 72 | return static_cast(-1) / sizeof(value_type); 73 | } 74 | 75 | void construct(pointer p, const value_type& val) { 76 | new(p) value_type(val); 77 | } 78 | void destroy(pointer p) { p->~value_type(); } 79 | 80 | template 81 | libc_allocator_with_realloc(const libc_allocator_with_realloc&) {} 82 | 83 | template 84 | struct rebind { 85 | typedef libc_allocator_with_realloc other; 86 | }; 87 | }; 88 | 89 | // libc_allocator_with_realloc specialization. 90 | template<> 91 | class libc_allocator_with_realloc { 92 | public: 93 | typedef void value_type; 94 | typedef size_t size_type; 95 | typedef ptrdiff_t difference_type; 96 | typedef void* pointer; 97 | typedef const void* const_pointer; 98 | 99 | template 100 | struct rebind { 101 | typedef libc_allocator_with_realloc other; 102 | }; 103 | }; 104 | 105 | template 106 | inline bool operator==(const libc_allocator_with_realloc&, 107 | const libc_allocator_with_realloc&) { 108 | return true; 109 | } 110 | 111 | template 112 | inline bool operator!=(const libc_allocator_with_realloc&, 113 | const libc_allocator_with_realloc&) { 114 | return false; 115 | } 116 | 117 | _END_GOOGLE_NAMESPACE_ 118 | 119 | #endif // UTIL_GTL_LIBC_ALLOCATOR_WITH_REALLOC_H_ 120 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/sparsehash/template_util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005 Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // ---- 31 | // 32 | // Template metaprogramming utility functions. 33 | // 34 | // This code is compiled directly on many platforms, including client 35 | // platforms like Windows, Mac, and embedded systems. Before making 36 | // any changes here, make sure that you're not breaking any platforms. 37 | // 38 | // 39 | // The names choosen here reflect those used in tr1 and the boost::mpl 40 | // library, there are similar operations used in the Loki library as 41 | // well. I prefer the boost names for 2 reasons: 42 | // 1. I think that portions of the Boost libraries are more likely to 43 | // be included in the c++ standard. 44 | // 2. It is not impossible that some of the boost libraries will be 45 | // included in our own build in the future. 46 | // Both of these outcomes means that we may be able to directly replace 47 | // some of these with boost equivalents. 48 | // 49 | #ifndef BASE_TEMPLATE_UTIL_H_ 50 | #define BASE_TEMPLATE_UTIL_H_ 51 | 52 | #include 53 | _START_GOOGLE_NAMESPACE_ 54 | 55 | // Types small_ and big_ are guaranteed such that sizeof(small_) < 56 | // sizeof(big_) 57 | typedef char small_; 58 | 59 | struct big_ { 60 | char dummy[2]; 61 | }; 62 | 63 | // Identity metafunction. 64 | template 65 | struct identity_ { 66 | typedef T type; 67 | }; 68 | 69 | // integral_constant, defined in tr1, is a wrapper for an integer 70 | // value. We don't really need this generality; we could get away 71 | // with hardcoding the integer type to bool. We use the fully 72 | // general integer_constant for compatibility with tr1. 73 | 74 | template 75 | struct integral_constant { 76 | static const T value = v; 77 | typedef T value_type; 78 | typedef integral_constant type; 79 | }; 80 | 81 | template const T integral_constant::value; 82 | 83 | 84 | // Abbreviations: true_type and false_type are structs that represent boolean 85 | // true and false values. Also define the boost::mpl versions of those names, 86 | // true_ and false_. 87 | typedef integral_constant true_type; 88 | typedef integral_constant false_type; 89 | typedef true_type true_; 90 | typedef false_type false_; 91 | 92 | // if_ is a templatized conditional statement. 93 | // if_ is a compile time evaluation of cond. 94 | // if_<>::type contains A if cond is true, B otherwise. 95 | template 96 | struct if_{ 97 | typedef A type; 98 | }; 99 | 100 | template 101 | struct if_ { 102 | typedef B type; 103 | }; 104 | 105 | 106 | // type_equals_ is a template type comparator, similar to Loki IsSameType. 107 | // type_equals_::value is true iff "A" is the same type as "B". 108 | // 109 | // New code should prefer base::is_same, defined in base/type_traits.h. 110 | // It is functionally identical, but is_same is the standard spelling. 111 | template 112 | struct type_equals_ : public false_ { 113 | }; 114 | 115 | template 116 | struct type_equals_ : public true_ { 117 | }; 118 | 119 | // and_ is a template && operator. 120 | // and_::value evaluates "A::value && B::value". 121 | template 122 | struct and_ : public integral_constant { 123 | }; 124 | 125 | // or_ is a template || operator. 126 | // or_::value evaluates "A::value || B::value". 127 | template 128 | struct or_ : public integral_constant { 129 | }; 130 | 131 | 132 | _END_GOOGLE_NAMESPACE_ 133 | 134 | #endif // BASE_TEMPLATE_UTIL_H_ 135 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for src/config.h 2 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/template_util_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005 Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // ---- 31 | // 32 | // These tests are really compile time tests. 33 | // If you try to step through this in a debugger 34 | // you will not see any evaluations, merely that 35 | // value is assigned true or false sequentially. 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | #include "testutil.h" 42 | 43 | using namespace GOOGLE_NAMESPACE; 44 | 45 | namespace { 46 | 47 | TEST(TemplateUtilTest, TestSize) { 48 | EXPECT_GT(sizeof(GOOGLE_NAMESPACE::big_), sizeof(GOOGLE_NAMESPACE::small_)); 49 | } 50 | 51 | TEST(TemplateUtilTest, TestIntegralConstants) { 52 | // test the built-in types. 53 | EXPECT_TRUE(true_type::value); 54 | EXPECT_FALSE(false_type::value); 55 | 56 | typedef integral_constant one_type; 57 | EXPECT_EQ(1, one_type::value); 58 | } 59 | 60 | TEST(TemplateUtilTest, TestTemplateIf) { 61 | typedef if_::type if_true; 62 | EXPECT_TRUE(if_true::value); 63 | 64 | typedef if_::type if_false; 65 | EXPECT_FALSE(if_false::value); 66 | } 67 | 68 | TEST(TemplateUtilTest, TestTemplateTypeEquals) { 69 | // Check that the TemplateTypeEquals works correctly. 70 | bool value = false; 71 | 72 | // Test the same type is true. 73 | value = type_equals_::value; 74 | EXPECT_TRUE(value); 75 | 76 | // Test different types are false. 77 | value = type_equals_::value; 78 | EXPECT_FALSE(value); 79 | 80 | // Test type aliasing. 81 | typedef const int foo; 82 | value = type_equals_::value; 83 | EXPECT_TRUE(value); 84 | } 85 | 86 | TEST(TemplateUtilTest, TestTemplateAndOr) { 87 | // Check that the TemplateTypeEquals works correctly. 88 | bool value = false; 89 | 90 | // Yes && Yes == true. 91 | value = and_::value; 92 | EXPECT_TRUE(value); 93 | // Yes && No == false. 94 | value = and_::value; 95 | EXPECT_FALSE(value); 96 | // No && Yes == false. 97 | value = and_::value; 98 | EXPECT_FALSE(value); 99 | // No && No == false. 100 | value = and_::value; 101 | EXPECT_FALSE(value); 102 | 103 | // Yes || Yes == true. 104 | value = or_::value; 105 | EXPECT_TRUE(value); 106 | // Yes || No == true. 107 | value = or_::value; 108 | EXPECT_TRUE(value); 109 | // No || Yes == true. 110 | value = or_::value; 111 | EXPECT_TRUE(value); 112 | // No || No == false. 113 | value = or_::value; 114 | EXPECT_FALSE(value); 115 | } 116 | 117 | TEST(TemplateUtilTest, TestIdentity) { 118 | EXPECT_TRUE( 119 | (type_equals_::type, int>::value)); 120 | EXPECT_TRUE( 121 | (type_equals_::type, void>::value)); 122 | } 123 | 124 | } // namespace 125 | 126 | #include 127 | 128 | int main(int, char **) { 129 | // All the work is done in the static constructors. If they don't 130 | // die, the tests have all passed. 131 | std::cout << "PASS\n"; 132 | return 0; 133 | } 134 | 135 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 35 4 | /svn/!svn/ver/106/trunk/src/windows 5 | END 6 | port.cc 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 43 10 | /svn/!svn/ver/106/trunk/src/windows/port.cc 11 | END 12 | port.h 13 | K 25 14 | svn:wc:ra_dav:version-url 15 | V 42 16 | /svn/!svn/ver/106/trunk/src/windows/port.h 17 | END 18 | config.h 19 | K 25 20 | svn:wc:ra_dav:version-url 21 | V 44 22 | /svn/!svn/ver/106/trunk/src/windows/config.h 23 | END 24 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/src/windows 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-01-31T23:50:02.386177Z 11 | 106 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | sparsehash 30 | dir 31 | 32 | port.cc 33 | file 34 | 35 | 36 | 37 | 38 | 2012-02-22T20:49:42.415760Z 39 | 151c78cf52673740bfb58bcc65e4d5ba 40 | 2012-01-31T23:50:02.386177Z 41 | 106 42 | csilvers 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 2661 65 | 66 | port.h 67 | file 68 | 69 | 70 | 71 | 72 | 2012-02-22T20:49:42.415760Z 73 | a4606eabefc5a8058fff503ea36c9d55 74 | 2012-01-31T23:50:02.386177Z 75 | 106 76 | csilvers 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 2948 99 | 100 | config.h 101 | file 102 | 103 | 104 | 105 | 106 | 2012-02-22T20:49:42.415760Z 107 | 956a5f41260940e9fa6666ffd256906e 108 | 2012-01-31T23:50:02.386177Z 109 | 106 110 | csilvers 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 4291 133 | 134 | google 135 | dir 136 | 137 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/.svn/text-base/config.h.svn-base: -------------------------------------------------------------------------------- 1 | #ifndef GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ 2 | #define GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ 3 | 4 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the location of or */ 13 | #define HASH_MAP_H 14 | 15 | /* the namespace of the hash<> function */ 16 | #define HASH_NAMESPACE stdext 17 | 18 | /* the location of or */ 19 | #define HASH_SET_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_GOOGLE_MALLOC_EXTENSION_H 23 | 24 | /* define if the compiler has hash_map */ 25 | #define HAVE_HASH_MAP 1 26 | 27 | /* define if the compiler has hash_set */ 28 | #define HAVE_HASH_SET 1 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_INTTYPES_H 32 | 33 | /* Define to 1 if the system has the type `long long'. */ 34 | #define HAVE_LONG_LONG 1 35 | 36 | /* Define to 1 if you have the `memcpy' function. */ 37 | #define HAVE_MEMCPY 1 38 | 39 | /* Define to 1 if you have the `memmove' function. */ 40 | #define HAVE_MEMMOVE 1 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_MEMORY_H 44 | 45 | /* define if the compiler implements namespaces */ 46 | #define HAVE_NAMESPACES 1 47 | 48 | /* Define if you have POSIX threads libraries and header files. */ 49 | #undef HAVE_PTHREAD 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_STDINT_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #define HAVE_STDLIB_H 1 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_STRINGS_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #define HAVE_STRING_H 1 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_SYS_RESOURCE_H 65 | 66 | /* Define to 1 if you have the header file. */ 67 | #define HAVE_SYS_STAT_H 1 68 | 69 | /* Define to 1 if you have the header file. */ 70 | #undef HAVE_SYS_TIME_H 71 | 72 | /* Define to 1 if you have the header file. */ 73 | #define HAVE_SYS_TYPES_H 1 74 | 75 | /* Define to 1 if you have the header file. */ 76 | #undef HAVE_SYS_UTSNAME_H 77 | 78 | /* Define to 1 if the system has the type `uint16_t'. */ 79 | #undef HAVE_UINT16_T 80 | 81 | /* Define to 1 if you have the header file. */ 82 | #undef HAVE_UNISTD_H 83 | 84 | /* define if the compiler supports unordered_{map,set} */ 85 | #undef HAVE_UNORDERED_MAP 86 | 87 | /* Define to 1 if the system has the type `u_int16_t'. */ 88 | #undef HAVE_U_INT16_T 89 | 90 | /* Define to 1 if the system has the type `__uint16'. */ 91 | #define HAVE___UINT16 1 92 | 93 | /* Name of package */ 94 | #undef PACKAGE 95 | 96 | /* Define to the address where bug reports for this package should be sent. */ 97 | #undef PACKAGE_BUGREPORT 98 | 99 | /* Define to the full name of this package. */ 100 | #undef PACKAGE_NAME 101 | 102 | /* Define to the full name and version of this package. */ 103 | #undef PACKAGE_STRING 104 | 105 | /* Define to the one symbol short name of this package. */ 106 | #undef PACKAGE_TARNAME 107 | 108 | /* Define to the home page for this package. */ 109 | #undef PACKAGE_URL 110 | 111 | /* Define to the version of this package. */ 112 | #undef PACKAGE_VERSION 113 | 114 | /* Define to necessary symbol if this constant uses a non-standard name on 115 | your system. */ 116 | #undef PTHREAD_CREATE_JOINABLE 117 | 118 | /* The system-provided hash function including the namespace. */ 119 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 120 | 121 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 122 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 123 | 124 | /* Define to 1 if you have the ANSI C header files. */ 125 | #define STDC_HEADERS 1 126 | 127 | /* Version number of package */ 128 | #undef VERSION 129 | 130 | /* Stops putting the code inside the Google namespace */ 131 | #define _END_GOOGLE_NAMESPACE_ } 132 | 133 | /* Puts following code inside the Google namespace */ 134 | #define _START_GOOGLE_NAMESPACE_ namespace google { 135 | 136 | 137 | // --------------------------------------------------------------------- 138 | // Extra stuff not found in config.h.in 139 | 140 | #define HAVE_WINDOWS_H 1 // used in time_hash_map 141 | 142 | // This makes sure the definitions in config.h and sparseconfig.h match 143 | // up. If they don't, the compiler will complain about redefinition. 144 | #include 145 | 146 | // TODO(csilvers): include windows/port.h in every relevant source file instead? 147 | #include "windows/port.h" 148 | 149 | #endif /* GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ */ 150 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/.svn/text-base/port.cc.svn-base: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | */ 33 | 34 | #include 35 | #ifndef WIN32 36 | # error You should only be including windows/port.cc in a windows environment! 37 | #endif 38 | 39 | #include "config.h" 40 | #include // for va_list, va_start, va_end 41 | #include "port.h" 42 | 43 | // Calls the windows _vsnprintf, but always NUL-terminate. 44 | int snprintf(char *str, size_t size, const char *format, ...) { 45 | if (size == 0) // not even room for a \0? 46 | return -1; // not what C99 says to do, but what windows does 47 | str[size-1] = '\0'; 48 | va_list ap; 49 | va_start(ap, format); 50 | const int r = _vsnprintf(str, size-1, format, ap); 51 | va_end(ap); 52 | return r; 53 | } 54 | 55 | std::string TmpFile(const char* basename) { 56 | char tmppath_buffer[1024]; 57 | int tmppath_len = GetTempPathA(sizeof(tmppath_buffer), tmppath_buffer); 58 | if (tmppath_len <= 0 || tmppath_len >= sizeof(tmppath_buffer)) { 59 | return basename; // an error, so just bail on tmppath 60 | } 61 | snprintf(tmppath_buffer + tmppath_len, sizeof(tmppath_buffer) - tmppath_len, 62 | "\\%s", basename); 63 | return tmppath_buffer; 64 | } 65 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/.svn/text-base/port.h.svn-base: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | * 33 | * These are some portability typedefs and defines to make it a bit 34 | * easier to compile this code -- in particular, unittests -- under VC++. 35 | * Other portability code is found in windows/sparsehash/internal/sparseconfig.h. 36 | * 37 | * Several of these are taken from glib: 38 | * http://developer.gnome.org/doc/API/glib/glib-windows-compatability-functions.html 39 | */ 40 | 41 | #ifndef SPARSEHASH_WINDOWS_PORT_H_ 42 | #define SPARSEHASH_WINDOWS_PORT_H_ 43 | 44 | #include 45 | #include "config.h" 46 | 47 | #ifdef WIN32 48 | 49 | #define WIN32_LEAN_AND_MEAN /* We always want minimal includes */ 50 | #include 51 | #include /* because we so often use open/close/etc */ 52 | #include 53 | 54 | // 4996: Yes, we're ok using the "unsafe" functions like _vsnprintf and fopen 55 | // 4127: We use "while (1)" sometimes: yes, we know it's a constant 56 | // 4181: type_traits_test is explicitly testing 'qualifier applied to reference' 57 | #pragma warning(disable:4996 4127 4181) 58 | 59 | 60 | // file I/O 61 | #define unlink _unlink 62 | #define strdup _strdup 63 | 64 | // We can't just use _snprintf as a drop-in replacement, because it 65 | // doesn't always NUL-terminate. :-( 66 | extern int snprintf(char *str, size_t size, const char *format, ...); 67 | 68 | extern std::string TmpFile(const char* basename); // used in hashtable_unittest 69 | 70 | #endif /* WIN32 */ 71 | 72 | #endif /* SPARSEHASH_WINDOWS_PORT_H_ */ 73 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/config.h: -------------------------------------------------------------------------------- 1 | #ifndef GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ 2 | #define GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ 3 | 4 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the location of or */ 13 | #define HASH_MAP_H 14 | 15 | /* the namespace of the hash<> function */ 16 | #define HASH_NAMESPACE stdext 17 | 18 | /* the location of or */ 19 | #define HASH_SET_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_GOOGLE_MALLOC_EXTENSION_H 23 | 24 | /* define if the compiler has hash_map */ 25 | #define HAVE_HASH_MAP 1 26 | 27 | /* define if the compiler has hash_set */ 28 | #define HAVE_HASH_SET 1 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_INTTYPES_H 32 | 33 | /* Define to 1 if the system has the type `long long'. */ 34 | #define HAVE_LONG_LONG 1 35 | 36 | /* Define to 1 if you have the `memcpy' function. */ 37 | #define HAVE_MEMCPY 1 38 | 39 | /* Define to 1 if you have the `memmove' function. */ 40 | #define HAVE_MEMMOVE 1 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_MEMORY_H 44 | 45 | /* define if the compiler implements namespaces */ 46 | #define HAVE_NAMESPACES 1 47 | 48 | /* Define if you have POSIX threads libraries and header files. */ 49 | #undef HAVE_PTHREAD 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_STDINT_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #define HAVE_STDLIB_H 1 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_STRINGS_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #define HAVE_STRING_H 1 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_SYS_RESOURCE_H 65 | 66 | /* Define to 1 if you have the header file. */ 67 | #define HAVE_SYS_STAT_H 1 68 | 69 | /* Define to 1 if you have the header file. */ 70 | #undef HAVE_SYS_TIME_H 71 | 72 | /* Define to 1 if you have the header file. */ 73 | #define HAVE_SYS_TYPES_H 1 74 | 75 | /* Define to 1 if you have the header file. */ 76 | #undef HAVE_SYS_UTSNAME_H 77 | 78 | /* Define to 1 if the system has the type `uint16_t'. */ 79 | #undef HAVE_UINT16_T 80 | 81 | /* Define to 1 if you have the header file. */ 82 | #undef HAVE_UNISTD_H 83 | 84 | /* define if the compiler supports unordered_{map,set} */ 85 | #undef HAVE_UNORDERED_MAP 86 | 87 | /* Define to 1 if the system has the type `u_int16_t'. */ 88 | #undef HAVE_U_INT16_T 89 | 90 | /* Define to 1 if the system has the type `__uint16'. */ 91 | #define HAVE___UINT16 1 92 | 93 | /* Name of package */ 94 | #undef PACKAGE 95 | 96 | /* Define to the address where bug reports for this package should be sent. */ 97 | #undef PACKAGE_BUGREPORT 98 | 99 | /* Define to the full name of this package. */ 100 | #undef PACKAGE_NAME 101 | 102 | /* Define to the full name and version of this package. */ 103 | #undef PACKAGE_STRING 104 | 105 | /* Define to the one symbol short name of this package. */ 106 | #undef PACKAGE_TARNAME 107 | 108 | /* Define to the home page for this package. */ 109 | #undef PACKAGE_URL 110 | 111 | /* Define to the version of this package. */ 112 | #undef PACKAGE_VERSION 113 | 114 | /* Define to necessary symbol if this constant uses a non-standard name on 115 | your system. */ 116 | #undef PTHREAD_CREATE_JOINABLE 117 | 118 | /* The system-provided hash function including the namespace. */ 119 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 120 | 121 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 122 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 123 | 124 | /* Define to 1 if you have the ANSI C header files. */ 125 | #define STDC_HEADERS 1 126 | 127 | /* Version number of package */ 128 | #undef VERSION 129 | 130 | /* Stops putting the code inside the Google namespace */ 131 | #define _END_GOOGLE_NAMESPACE_ } 132 | 133 | /* Puts following code inside the Google namespace */ 134 | #define _START_GOOGLE_NAMESPACE_ namespace google { 135 | 136 | 137 | // --------------------------------------------------------------------- 138 | // Extra stuff not found in config.h.in 139 | 140 | #define HAVE_WINDOWS_H 1 // used in time_hash_map 141 | 142 | // This makes sure the definitions in config.h and sparseconfig.h match 143 | // up. If they don't, the compiler will complain about redefinition. 144 | #include 145 | 146 | // TODO(csilvers): include windows/port.h in every relevant source file instead? 147 | #include "windows/port.h" 148 | 149 | #endif /* GOOGLE_SPARSEHASH_WINDOWS_CONFIG_H_ */ 150 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 41 4 | /svn/!svn/ver/66/trunk/src/windows/google 5 | END 6 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/src/windows/google 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2011-06-24T05:00:21.294954Z 11 | 66 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | sparsehash 30 | dir 31 | 32 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/sparsehash/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 52 4 | /svn/!svn/ver/66/trunk/src/windows/google/sparsehash 5 | END 6 | sparseconfig.h 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 67 10 | /svn/!svn/ver/66/trunk/src/windows/google/sparsehash/sparseconfig.h 11 | END 12 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/sparsehash/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/src/windows/google/sparsehash 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2011-06-24T05:00:21.294954Z 11 | 66 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | sparseconfig.h 30 | file 31 | 32 | 33 | 34 | 35 | 2012-02-22T20:49:42.415760Z 36 | 67cc0408754e0a62822995e4b4227bb9 37 | 2011-06-24T05:00:21.294954Z 38 | 66 39 | csilvers 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1445 62 | 63 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/sparsehash/.svn/text-base/sparseconfig.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE stdext 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if the system has the type `long long'. */ 19 | #define HAVE_LONG_LONG 1 20 | 21 | /* Define to 1 if you have the `memcpy' function. */ 22 | #define HAVE_MEMCPY 1 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #define HAVE_SYS_TYPES_H 1 29 | 30 | /* Define to 1 if the system has the type `uint16_t'. */ 31 | #undef HAVE_UINT16_T 32 | 33 | /* Define to 1 if the system has the type `u_int16_t'. */ 34 | #undef HAVE_U_INT16_T 35 | 36 | /* Define to 1 if the system has the type `__uint16'. */ 37 | #define HAVE___UINT16 1 38 | 39 | /* The system-provided hash function including the namespace. */ 40 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 41 | 42 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 43 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 44 | 45 | /* Stops putting the code inside the Google namespace */ 46 | #define _END_GOOGLE_NAMESPACE_ } 47 | 48 | /* Puts following code inside the Google namespace */ 49 | #define _START_GOOGLE_NAMESPACE_ namespace google { 50 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/google/sparsehash/sparseconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE stdext 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if the system has the type `long long'. */ 19 | #define HAVE_LONG_LONG 1 20 | 21 | /* Define to 1 if you have the `memcpy' function. */ 22 | #define HAVE_MEMCPY 1 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #define HAVE_SYS_TYPES_H 1 29 | 30 | /* Define to 1 if the system has the type `uint16_t'. */ 31 | #undef HAVE_UINT16_T 32 | 33 | /* Define to 1 if the system has the type `u_int16_t'. */ 34 | #undef HAVE_U_INT16_T 35 | 36 | /* Define to 1 if the system has the type `__uint16'. */ 37 | #define HAVE___UINT16 1 38 | 39 | /* The system-provided hash function including the namespace. */ 40 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 41 | 42 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 43 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 44 | 45 | /* Stops putting the code inside the Google namespace */ 46 | #define _END_GOOGLE_NAMESPACE_ } 47 | 48 | /* Puts following code inside the Google namespace */ 49 | #define _START_GOOGLE_NAMESPACE_ namespace google { 50 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/port.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | */ 33 | 34 | #include 35 | #ifndef WIN32 36 | # error You should only be including windows/port.cc in a windows environment! 37 | #endif 38 | 39 | #include "config.h" 40 | #include // for va_list, va_start, va_end 41 | #include "port.h" 42 | 43 | // Calls the windows _vsnprintf, but always NUL-terminate. 44 | int snprintf(char *str, size_t size, const char *format, ...) { 45 | if (size == 0) // not even room for a \0? 46 | return -1; // not what C99 says to do, but what windows does 47 | str[size-1] = '\0'; 48 | va_list ap; 49 | va_start(ap, format); 50 | const int r = _vsnprintf(str, size-1, format, ap); 51 | va_end(ap); 52 | return r; 53 | } 54 | 55 | std::string TmpFile(const char* basename) { 56 | char tmppath_buffer[1024]; 57 | int tmppath_len = GetTempPathA(sizeof(tmppath_buffer), tmppath_buffer); 58 | if (tmppath_len <= 0 || tmppath_len >= sizeof(tmppath_buffer)) { 59 | return basename; // an error, so just bail on tmppath 60 | } 61 | snprintf(tmppath_buffer + tmppath_len, sizeof(tmppath_buffer) - tmppath_len, 62 | "\\%s", basename); 63 | return tmppath_buffer; 64 | } 65 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/port.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007, Google Inc. 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above 11 | * copyright notice, this list of conditions and the following disclaimer 12 | * in the documentation and/or other materials provided with the 13 | * distribution. 14 | * * Neither the name of Google Inc. nor the names of its 15 | * contributors may be used to endorse or promote products derived from 16 | * this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * --- 31 | * Author: Craig Silverstein 32 | * 33 | * These are some portability typedefs and defines to make it a bit 34 | * easier to compile this code -- in particular, unittests -- under VC++. 35 | * Other portability code is found in windows/sparsehash/internal/sparseconfig.h. 36 | * 37 | * Several of these are taken from glib: 38 | * http://developer.gnome.org/doc/API/glib/glib-windows-compatability-functions.html 39 | */ 40 | 41 | #ifndef SPARSEHASH_WINDOWS_PORT_H_ 42 | #define SPARSEHASH_WINDOWS_PORT_H_ 43 | 44 | #include 45 | #include "config.h" 46 | 47 | #ifdef WIN32 48 | 49 | #define WIN32_LEAN_AND_MEAN /* We always want minimal includes */ 50 | #include 51 | #include /* because we so often use open/close/etc */ 52 | #include 53 | 54 | // 4996: Yes, we're ok using the "unsafe" functions like _vsnprintf and fopen 55 | // 4127: We use "while (1)" sometimes: yes, we know it's a constant 56 | // 4181: type_traits_test is explicitly testing 'qualifier applied to reference' 57 | #pragma warning(disable:4996 4127 4181) 58 | 59 | 60 | // file I/O 61 | #define unlink _unlink 62 | #define strdup _strdup 63 | 64 | // We can't just use _snprintf as a drop-in replacement, because it 65 | // doesn't always NUL-terminate. :-( 66 | extern int snprintf(char *str, size_t size, const char *format, ...); 67 | 68 | extern std::string TmpFile(const char* basename); // used in hashtable_unittest 69 | 70 | #endif /* WIN32 */ 71 | 72 | #endif /* SPARSEHASH_WINDOWS_PORT_H_ */ 73 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 46 4 | /svn/!svn/ver/106/trunk/src/windows/sparsehash 5 | END 6 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/src/windows/sparsehash 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-01-31T23:50:02.386177Z 11 | 106 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | internal 30 | dir 31 | 32 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/internal/.svn/all-wcprops: -------------------------------------------------------------------------------- 1 | K 25 2 | svn:wc:ra_dav:version-url 3 | V 55 4 | /svn/!svn/ver/106/trunk/src/windows/sparsehash/internal 5 | END 6 | sparseconfig.h 7 | K 25 8 | svn:wc:ra_dav:version-url 9 | V 70 10 | /svn/!svn/ver/106/trunk/src/windows/sparsehash/internal/sparseconfig.h 11 | END 12 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/internal/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 113 5 | https://sparsehash.googlecode.com/svn/trunk/src/windows/sparsehash/internal 6 | https://sparsehash.googlecode.com/svn 7 | 8 | 9 | 10 | 2012-01-31T23:50:02.386177Z 11 | 106 12 | csilvers 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 21bedea4-f223-4c8b-73d6-85019ffb75a9 28 | 29 | sparseconfig.h 30 | file 31 | 32 | 33 | 34 | 35 | 2012-02-22T20:49:42.407760Z 36 | 67cc0408754e0a62822995e4b4227bb9 37 | 2012-01-31T23:50:02.386177Z 38 | 106 39 | csilvers 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1445 62 | 63 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/internal/.svn/text-base/sparseconfig.h.svn-base: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE stdext 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if the system has the type `long long'. */ 19 | #define HAVE_LONG_LONG 1 20 | 21 | /* Define to 1 if you have the `memcpy' function. */ 22 | #define HAVE_MEMCPY 1 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #define HAVE_SYS_TYPES_H 1 29 | 30 | /* Define to 1 if the system has the type `uint16_t'. */ 31 | #undef HAVE_UINT16_T 32 | 33 | /* Define to 1 if the system has the type `u_int16_t'. */ 34 | #undef HAVE_U_INT16_T 35 | 36 | /* Define to 1 if the system has the type `__uint16'. */ 37 | #define HAVE___UINT16 1 38 | 39 | /* The system-provided hash function including the namespace. */ 40 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 41 | 42 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 43 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 44 | 45 | /* Stops putting the code inside the Google namespace */ 46 | #define _END_GOOGLE_NAMESPACE_ } 47 | 48 | /* Puts following code inside the Google namespace */ 49 | #define _START_GOOGLE_NAMESPACE_ namespace google { 50 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/src/windows/sparsehash/internal/sparseconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE stdext 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if the system has the type `long long'. */ 19 | #define HAVE_LONG_LONG 1 20 | 21 | /* Define to 1 if you have the `memcpy' function. */ 22 | #define HAVE_MEMCPY 1 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #define HAVE_SYS_TYPES_H 1 29 | 30 | /* Define to 1 if the system has the type `uint16_t'. */ 31 | #undef HAVE_UINT16_T 32 | 33 | /* Define to 1 if the system has the type `u_int16_t'. */ 34 | #undef HAVE_U_INT16_T 35 | 36 | /* Define to 1 if the system has the type `__uint16'. */ 37 | #define HAVE___UINT16 1 38 | 39 | /* The system-provided hash function including the namespace. */ 40 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash_compare 41 | 42 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 43 | #define SPARSEHASH_HASH_NO_NAMESPACE hash_compare 44 | 45 | /* Stops putting the code inside the Google namespace */ 46 | #define _END_GOOGLE_NAMESPACE_ } 47 | 48 | /* Puts following code inside the Google namespace */ 49 | #define _START_GOOGLE_NAMESPACE_ namespace google { 50 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/hashtable_test/hashtable_test.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 159 | 160 | 162 | 163 | 165 | 166 | 168 | 169 | 171 | 172 | 174 | 175 | 177 | 178 | 180 | 181 | 183 | 184 | 186 | 187 | 189 | 190 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/libc_allocator_with_realloc_test/libc_allocator_with_realloc_test.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/simple_test/simple_test.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 159 | 160 | 162 | 163 | 165 | 166 | 168 | 169 | 171 | 172 | 174 | 175 | 177 | 178 | 180 | 181 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/sparsetable_unittest/sparsetable_unittest.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 159 | 160 | 162 | 163 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/time_hash_map/time_hash_map.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 159 | 160 | 162 | 163 | 165 | 166 | 168 | 169 | 171 | 172 | 174 | 175 | 177 | 178 | 180 | 181 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /ext/sparsehash-2.0.2/vsprojects/type_traits_unittest/type_traits_unittest.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 29 | 31 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 60 | 66 | 73 | 75 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 115 | 117 | 120 | 121 | 123 | 126 | 127 | 128 | 130 | 132 | 135 | 136 | 138 | 141 | 142 | 143 | 144 | 148 | 150 | 151 | 153 | 154 | 156 | 157 | 159 | 160 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /ext/spec.bat: -------------------------------------------------------------------------------- 1 | ruby -C ../spec spec.google_hash.rb -------------------------------------------------------------------------------- /ext/template/main.cpp.erb: -------------------------------------------------------------------------------- 1 | 2 | extern "C" { 3 | #include 4 | // like extern void init_dense_ruby_to_ruby_; 5 | <% init_funcs.each do |func| %> 6 | <%= "extern void #{func}();" %> 7 | <% end %> 8 | 9 | void Init_google_hash() { 10 | 11 | <% init_funcs.each do |func| %> 12 | <%= func %>(); 13 | <% end %> 14 | 15 | rb_eval_string("::GoogleHash = ::GoogleHashDenseRubyToRuby"); // give a default 16 | } 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /results.txt: -------------------------------------------------------------------------------- 1 | 1.9.3 linux: 2 | 3 | https://gist.github.com/3867418 4 | 5 | Here some 1.9 mingw results 6 | 7 | http://pastie.org/752318 8 | 9 | 1.9.2 linux: 10 | 11 | http://pastie.org/752333 12 | 13 | ruby 1.8.6 mingw: 14 | 15 | https://gist.github.com/3867210 16 | 17 | 1.8.6 linux: 18 | 19 | https://gist.github.com/3867231 20 | 21 | -------------------------------------------------------------------------------- /spec/bench_gc.rb: -------------------------------------------------------------------------------- 1 | require 'sane' 2 | require_relative '../ext/google_hash' 3 | require 'benchmark' 4 | if !ARGV[0].in? ['sparse', 'dense', 'ruby'] 5 | puts 'syntax: bench_gc.rb sparse|dense|ruby' 6 | exit 1 7 | end 8 | 9 | p ARGV[0] 10 | if ARGV[0] == 'sparse' 11 | a = GoogleHashSparseIntToInt.new 12 | elsif ARGV[0] == 'dense' 13 | a = GoogleHashDenseIntToInt.new 14 | elsif ARGV[0] == 'ruby' 15 | a = Hash.new 16 | else 17 | throw 'never get here' 18 | end 19 | 20 | took = Benchmark.realtime { 2_000_000.times {|i| a[i] = i} } 21 | 22 | p 'took second', took.group_digits, 'mem used:', OS.rss_bytes.group_digits, 'each gc now takes', Benchmark.realtime {GC.start}.group_digits, ObjectSpace.count_objects -------------------------------------------------------------------------------- /spec/benchmark.rb: -------------------------------------------------------------------------------- 1 | require 'sane' # gem 2 | require_relative '../ext/google_hash' 3 | require 'benchmark' 4 | require 'hitimes' # gem 5 | 6 | def measure 7 | Hitimes::Interval.measure { yield } 8 | end 9 | 10 | def meas string 11 | time_took = measure { yield } 12 | puts "% -23s %.03f" % [string, time_took] 13 | end 14 | 15 | def go num 16 | puts RUBY_DESCRIPTION 17 | puts "inserting #{num} objects" 18 | puts "remember that these may be more RAM space efficient than ruby's standard hash, as well, esp. the sparse hash--see the file bench_gc.rb" 19 | puts "double is like float, long is like a large int" 20 | # get all existing 21 | all_google_hashmap_classes = Object.constants.grep(/^GoogleHash.*/).reject{|n| n == :GoogleHash}.map{|n| eval n.to_s} 22 | all = all_google_hashmap_classes + [Hash] 23 | 24 | for name in all do 25 | GC.start # try to clear the previous run's hash from memory :) 26 | GC.disable # don't let this taint runs 27 | subject = name.new 28 | puts 29 | if name == Hash 30 | puts "Ruby Standard Hash" 31 | else 32 | puts name 33 | end 34 | 35 | subject = name.new 36 | meas( "populate string ") { num.times {|n| subject['abc'] = 4 } } rescue nil 37 | subject = name.new 38 | meas( "populate symbol") { num.times {|n| subject[:abc] = 4} } rescue nil 39 | 40 | meas( "populate integer") { num.times {|n| subject[n] = 4}} 41 | meas("#each") { subject.each{|k, v| } } 42 | 43 | begin 44 | subject = name.new 45 | subject[3] = 4 46 | meas("lookup int") { num.times {|n| subject[3]}} 47 | subject['abc'] = 3 48 | subject[:abc] = 3 49 | 50 | meas("lookup string") { num.times {|n| subject['abc']}} 51 | meas( "lookup symbol" ) { num.times {|n| subject[:abc]}} 52 | rescue # most don't support these... 53 | end 54 | end 55 | end 56 | 57 | num = 400_000 58 | go num if $0 ==__FILE__ 59 | -------------------------------------------------------------------------------- /spec/scale.rb: -------------------------------------------------------------------------------- 1 | require 'sane' 2 | require_relative 'benchmark' 3 | 4 | for n in [100_000, 500_000, 1_000_000, 10_000_000, 150000000] do # 1_000_000 is about the last one that doesn't have an awful each 5 | go n 6 | end 7 | -------------------------------------------------------------------------------- /to_build_locally_run_ext_go_bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rdp/google_hash/c42b481411247c045c518b21df273641baf0b12b/to_build_locally_run_ext_go_bat --------------------------------------------------------------------------------