ext/extconf.rb in google_hash-0.8.9 vs ext/extconf.rb in google_hash-0.9.0
- old
+ new
@@ -37,11 +37,12 @@
unreachable_int = "1<<31"
unreachable_long = "(long) 1<<63" # TODO NaN here instead or something? land mine otherwise? hmm...
end
ruby_key = {:convert_keys_from_ruby => "", :convert_keys_to_ruby => "", :key_type => "VALUE", :english_key_type => "ruby",
- :extra_hash_params => ", hashrb, eqrb", :unreachable_key => "current_instance"} # TODO unreachable -> NULL instead?
+ :extra_hash_params => ", hashrb, eqrb", :unreachable_key => "(VALUE) 0", :deleted_key => "(VALUE) -1"}
+# VALUE is a 64bit pointer as far as I can tell...so using 0 OK here since they'll never be NULL in real C land
int_key = {:assert_key_type => 'T_FIXNUM', :convert_keys_from_ruby => "FIX2INT",
:convert_keys_to_ruby => "INT2FIX", :key_type => "int", :unreachable_key => "#{unreachable_int}"}
# "long" is useful on 64 bit...since it can handle a wider range of incoming int's
@@ -76,9 +77,10 @@
options = key.merge(value)
for type in ['sparse', 'dense'] do
# create local variables so that the template can look cleaner
unreachable_key = options[:unreachable_key]
+ deleted_key = options[:deleted_key] || "(#{options[:unreachable_key]}) - 1"
convert_keys_from_ruby = options[:convert_keys_from_ruby]
convert_keys_to_ruby = options[:convert_keys_to_ruby]
key_type = options[:key_type]
value_type = options[:value_type]
english_key_type = options[:english_key_type] || options[:key_type]