aboutsummaryrefslogtreecommitdiffstats
path: root/st.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * st.c (st_locale_insensitive_strcasecmp): Renamed from st_strcasecmp.akr2013-07-161-3/+3
| | | | | | | | | | | | (st_locale_insensitive_strncasecmp): Renamed from st_strncasecmp. * include/ruby/st.h: Follow above changes. * include/ruby/ruby.h: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: revert r42008. strcasecmp() uses the current locale.glass2013-07-161-2/+0
| | | | | | | | * include/ruby/ruby.h: ditto. * st.c (st_strcasecmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: check strcasecmp().glass2013-07-161-0/+2
| | | | | | | | | | * include/ruby/ruby.h: use strcasecmp() as st_strcasecmp() if it exists. * st.c (st_strcasecmp): define the function only if strcasecmp() doesn't exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_shift): remove unused variable.nobu2013-04-251-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * benchmark/bm_hash_shift.rb: add benchmark for Hash#shiftcharliesome2013-04-251-0/+29
| | | | | | | | | | | | | | | * hash.c (rb_hash_shift): use st_shift if hash is not being iterated to delete element without iterating the whole hash. * hash.c (shift_i): remove function * include/ruby/st.h (st_shift): add st_shift function * st.c (st_shift): ditto [Bug #8312] [ruby-core:54524] Patch by funny-falcon git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed comment typo, found by @ThePablickzzak2013-04-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regint.h: fix typo: _M_AMD86 -> _M_AMD64.naruse2013-04-101-1/+1
| | | | | | | | * siphash.c: ditto. * st.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st_update passes the key in st_tableshirosaki2012-11-171-0/+2
| | | | | | | | | | | * st.c (st_update): pass the key in st_table so that we can free memory of the key in st_table when deleting. [ruby-core:49220] [Bug #7330] * test/-ext-/st/test_update.rb (Bug::StTable#test_pass_objects_in_st_table): add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_foreach_check, st_foreach): remove ancient check. Thisnobu2012-03-311-2/+0
| | | | | | | check are from initial ordered hash commit when first entry were created with entry->fore = entry->back = entry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_delete): use real_entries in st_delete for packed tablesnobu2012-03-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_foreach_check): remove the entry by replacing with nevernobu2012-03-301-8/+13
| | | | | | | when ST_DELETE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): pass pointer to key to the callback function.nobu2012-03-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): add existing parameter to the callback function.nobu2012-03-291-13/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: pack tables also generic keys. patched by Sokolov Yura atnobu2012-03-101-38/+63
| | | | | | | https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: add st_foreach_check for fixing iteration over packed tablenobu2012-03-101-12/+85
| | | | | | | | and st_delete_safe. patched by Sokolov Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: fix packed num_entries on delete_safe. patched by Sokolovnobu2012-03-101-34/+31
| | | | | | | Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): chain entries directly. based on a patchnobu2012-03-051-11/+33
| | | | | | | by Sokolov Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): use union instead of casted pointer.nobu2012-03-051-7/+13
| | | | | | | patched by Sokolov Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: use PACKED_ENT and FIND_ENTRY. patched by Sokolovnobu2012-03-051-10/+5
| | | | | | | Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): reallocate bins if packed array sizenobu2012-03-051-0/+5
| | | | | | | | is not same as initial bins size. based on a patch by Sokolov Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: refactor packed entries using structs.nobu2012-02-071-20/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): table can be unpacked in the callback.nobu2012-02-071-2/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_foreach): should not yield same pair when checkingnobu2012-02-071-11/+17
| | | | | | | after unpacking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (add_packed_direct): ditto.nobu2012-01-171-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (do_hash): it's the time to remove cast to unsigned int.nobu2012-01-171-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): Fix r34310: on unpacking, the position ofnaruse2012-01-161-2/+3
| | | | | | | | a hash must be do_hash-ed value. * st.c (add_packed_direct): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st optimize st_insertshyouhei2012-01-151-10/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st refactor add_packed_direct a bitshyouhei2012-01-151-13/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st macroses for allocationshyouhei2012-01-151-23/+33
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st macroses for packed tableshyouhei2012-01-151-43/+49
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st use function instead of macroshyouhei2012-01-151-159/+161
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): new function to lookup the given key andnobu2011-12-271-0/+56
| | | | | | | update the value. [ruby-dev:44998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (identhash): share with type_numhash.nobu2011-10-181-1/+2
| | | | | | * st.c (st_hashtype_num): rename from type_numhash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regint.h (PLATFORM_UNALIGNED_WORD_ACCESS): Power PC does notnobu2011-07-141-1/+3
| | | | | | | | allow unaligned word access. * st.c (UNALIGNED_WORD_ACCESS): x86_64 allows unaligned word access as well as i386. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_foreach): check if unpacked.nobu2011-01-271-1/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: parenthesize macro arguments.akr2010-12-311-32/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (MurmurMagic): get rid of literal overflow.nobu2010-10-121-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_foreach): don't access ptr->hash after func call.akr2010-02-151-1/+1
| | | | | | | It may access freed area. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (SIZEOF_ST_INDEX_T): moved from st.c fornobu2009-11-041-3/+0
| | | | | | | Init_RandomSeed(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): fixed type.nobu2009-10-311-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): save table->bins and never change the tablewanabe2009-10-161-8/+10
| | | | | | | during unpacking. Because st_insert() may cause GC and refer the table, i.e. st_foreach(). [Bug #2196] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: moved murmur hash from string.c. [ruby-dev:39376]nobu2009-09-261-0/+257
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (COLLISION): improved collision log feature.nobu2009-09-261-9/+50
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_table_entry, st_get_key): use st_index_t.nobu2009-09-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_free_table): constified.nobu2009-09-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_init_*table_with_size): use st_index_t.nobu2009-09-081-27/+27
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_delete_safe): deals with packed entries.nobu2009-08-241-0/+28
| | | | | | | | | [ruby-core:25080] * st.c (st_cleanup_safe): ditto. [ruby-core:25081] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c, include/ruby/st.h (st_memsize): added. This function returnsko12009-06-161-0/+11
| | | | | | | | the memory usage of st_talbe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_insert2): new function with processing new key,matz2009-05-271-0/+40
| | | | | | | | | e.g. copy. * hash.c (rb_hash_aset): use st_insert2() to reduce redundant st_lookup calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e