aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/st.h
Commit message (Collapse)AuthorAgeFilesLines
* * configure.in: check function attirbute const and pure,naruse2016-05-081-10/+10
| | | | | | | | | | | | and define CONSTFUNC and PUREFUNC if available. Note that I don't add those options as default because it still shows many false-positive (it seems not to consider longjmp). * vm_eval.c (stack_check): get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: use ccan linked-list (try 3)normal2015-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the bm_vm2_bighash benchmark significantly by removing branches during insert, but slows down anything requiring iteration with the more complex loop termination checking. Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash benchmark. v3 - st_head calculates list_head address in two steps to avoid a bug in old gcc 4.4 (Debian 4.4.7-2) bug which incorrectly warned with: warning: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules * include/ruby/st.h (struct st_table): hide struct list_head * st.c (struct st_table_entry): adjust struct (head, tail): remove shortcut macros (st_head): new wrapper function (st_init_table_with_size): adjust to new struct and API (st_clear): ditto (add_direct): ditto (unpack_entries): ditto (rehash): ditto (st_copy): ditto (remove_entry): ditto (st_shift): ditto (st_foreach_check): ditto (st_foreach): ditto (get_keys): ditto (get_values): ditto (st_values_check): ditto (st_reverse_foreach_check): ditto (unused) (st_reverse_foreach): ditto (unused) [ruby-core:69726] [Misc #10278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "st.c: use ccan linked-list (try 2)"normal2015-06-261-1/+1
| | | | | | | | This reverts commit r51044 Still getting failure notices from ko1's CI machine. ref: g3qkqn git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: use ccan linked-list (try 2)normal2015-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the bm_vm2_bighash benchmark significantly by removing branches during insert, but slows down anything requiring iteration with the more complex loop termination checking. Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash benchmark. * include/ruby/st.h (struct st_table): hide struct list_head * st.c (struct st_table_entry): adjust struct (head, tail): remove shortcut macros (st_head): new wrapper function (st_init_table_with_size): adjust to new struct and API (st_clear): ditto (add_direct): ditto (unpack_entries): ditto (rehash): ditto (st_copy): ditto (remove_entry): ditto (st_shift): ditto (st_foreach_check): ditto (st_foreach): ditto (get_keys): ditto (get_values): ditto (st_values_check): ditto (st_reverse_foreach_check): ditto (unused) (st_reverse_foreach): ditto (unused) [ruby-core:69726] [Misc #10278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r51034 "st.c: use ccan linked-list"normal2015-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Maybe this will stop mysterious CI failures from ko1@sasada-8core: リビジョン 51034 です。 make[1]: ディレクトリ `/mnt/sdb1/ruby/build' に入ります ../trunk/revision.h unchanged make[1]: ディレクトリ `/mnt/sdb1/ruby/build' から出ます make[1]: ディレクトリ `/mnt/sdb1/ruby/build' に入ります config.guess already exists config.sub already exists generating ../trunk/ext/ripper/ripper.c make[2]: ディレクトリ `/mnt/sdb1/ruby/trunk/ext/ripper' に入ります extracting ripper.y from ../../parse.y id.h not found in ["../.."] make[2]: *** [ripper.y] エラー 1 make[2]: ディレクトリ `/mnt/sdb1/ruby/trunk/ext/ripper' から出ます make[1]: *** [../trunk/ext/ripper/ripper.c] エラー 2 make[1]: ディレクトリ `/mnt/sdb1/ruby/build' から出ます make: [up] エラー 2 (無視されました) make: *** [.rbconfig.time] セグメンテーション違反です Command exited with non-zero status 2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: use ccan linked-listnormal2015-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the bm_vm2_bighash benchmark significantly by removing branches during insert, but slows down anything requiring iteration with the more complex loop termination checking. Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash benchmark. * include/ruby/st.h (struct st_table): hide struct list_head * st.c (struct st_table_entry): adjust struct (head, tail): remove shortcut macros (st_head): new wrapper function (st_init_table_with_size): adjust to new struct and API (st_clear): ditto (add_direct): ditto (unpack_entries): ditto (rehash): ditto (st_copy): ditto (remove_entry): ditto (st_shift): ditto (st_foreach_check): ditto (st_foreach): ditto (get_keys): ditto (get_values): ditto (st_values_check): ditto (st_reverse_foreach_check): ditto (unused) (st_reverse_foreach): ditto (unused) [ruby-core:69726] [Misc #10278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovantonhsbt2015-06-041-1/+1
| | | | | | | | [fix GH-923] * include/ruby/st.h: ditto. * include/ruby/util.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: remove equality checksnobu2014-07-061-0/+3
| | | | | | | * st.c (st_update): remove equality checks, callers should ensure the equality, otherwise the behavior is undefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: add st_values() and st_values_check().glass2013-11-281-0/+2
| | | | | | | | | * include/ruby/st.h: add prototypes for above. * hash.c (rb_hash_values): use st_values_check() for performance improvement if VALUE and st_data_t are compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_keys): fix not to use Qundef in st.c.glass2013-11-281-0/+1
| | | | | | | | * include/ruby/st.h: define modified prototype. * hash.c (rb_hash_keys): use modified st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_keys): define st_keys(). it writes each key to buffer.glass2013-11-271-0/+8
| | | | | | | | | | | | | * hash.c (rb_hash_keys): use st_keys() for performance improvement if st_data_t and VALUE are compatible. * st.h: define macro ST_DATA_COMPATIBLE_P() to predicate whether st_data_t and passed type are compatible. * configure.in: check existence of builtin function to use in ST_DATA_COMPATIBLE_P(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* st.c: revert st_keysnobu2013-10-101-1/+0
| | | | | | * st.c: revert st_keys() at r43238. VALUE cannot be in st.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_keys): define st_keys() for performance improvement ofglass2013-10-101-0/+1
| | | | | | | | | | Hash#keys and Array#uniq. * st.h: ditto. * hash.c (rb_hash_keys): use st_keys(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_strcasecmp): Macro defined for compatibility.akr2013-07-171-0/+2
| | | | | | | | (st_strncasecmp): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_locale_insensitive_strcasecmp): Renamed from st_strcasecmp.akr2013-07-161-2/+2
| | | | | | | | | | | | (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
* * benchmark/bm_hash_shift.rb: add benchmark for Hash#shiftcharliesome2013-04-251-0/+1
| | | | | | | | | | | | | | | * 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
* defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END}nobu2013-04-051-6/+2
| | | | | | | * include/ruby/defines.h (RUBY_SYMBOL_EXPORT_{BEGIN,END}): visibility control macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Delete redundant inclusions caused byakr2013-03-271-13/+0
| | | | | | | | | | | | | | AC_INCLUDES_DEFAULT in defines.h. * include/ruby/defines.h: Ditto. * include/ruby/ruby.h: Ditto. * include/ruby/st.h: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): pass pointer to key to the callback function.nobu2012-03-291-1/+1
| | | | 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-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: add st_foreach_check for fixing iteration over packed tablenobu2012-03-101-0/+1
| | | | | | | | 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-1/+4
| | | | | | | 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): use union instead of casted pointer.nobu2012-03-051-2/+7
| | | | | | | 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
* * include/ruby/ruby.h: fix #error pragma. LLP64 platform is supported.nagachika2011-12-281-1/+1
| | | | | | * include/ruby/st.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): new function to lookup the given key andnobu2011-12-271-0/+1
| | | | | | | update the value. [ruby-dev:44998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h: parenthesize macro arguments.akr2011-04-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_table): Added comment why we need __extension__.kosaki2011-02-011-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * defines.h, intern.h, missing.h, ruby.h, st.h, util.h: includenobu2010-07-271-6/+0
| | | | | | | config.h and defines.h for autoconf macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (XCFLAGS): use -fvisibility=hidden if possible.nobu2010-07-211-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * version.c (RUBY_LIB, RUBY_*_LIB): moved from configures.nobu2010-01-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (SIZEOF_ST_INDEX_T): moved from st.c fornobu2009-11-041-0/+3
| | | | | | | Init_RandomSeed(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h: include inttypes.h and stdint.h.naruse2009-09-281-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/st.h: aligned prototype of st_hash_uint32 with functionduerst2009-09-281-1/+1
| | | | | | definition (fixing compiling problem on cygwin) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: moved murmur hash from string.c. [ruby-dev:39376]nobu2009-09-261-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wed Sep 9 15:24:32 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>takano322009-09-091-0/+1
| | | | | | | | | * include/ruby/st.h : revert previous commit. * ext/objspace/objspace.c : remove st_memsize declare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wed Sep 9 14:07:19 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>takano322009-09-091-1/+0
| | | | | | | | * include/ruby/st.h : fix duplicate st_memsize declare. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24815 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-4/+4
| | | | 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-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c, include/ruby/st.h (st_memsize): added. This function returnsko12009-06-161-0/+1
| | | | | | | | 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/+1
| | | | | | | | | 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
* * include/ruby/st.h, st.c: order entries by a linked list instead ofmame2009-02-081-1/+1
| | | | | | | | a loop to fix iteration miss when hash is modified during iteration. [ruby-dev:37910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h: need to include defines.h because LONG_LONG isusa2008-12-231-0/+1
| | | | | | | | defined there. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (size_t): needs stddef.h or stdlib.h.nobu2008-12-111-0/+13
| | | | | | | [ruby-core:20339] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a comment.akr2008-08-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (struct st_table): type of bit-fieldshyouhei2008-07-011-0/+3
| | | | | | | 'num_entries' is a GCC extension git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_isascii): defined.akr2008-01-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_isalnum): ditto. (rb_isalpha): ditto. (rb_isblank): ditto. (rb_iscntrl): ditto. (rb_isdigit): ditto. (rb_isgraph): ditto. (rb_islower): ditto. (rb_isprint): ditto. (rb_ispunct): ditto. (rb_isspace): ditto. (rb_isupper): ditto. (rb_isxdigit): ditto. (rb_tolower): ditto. (rb_toupper): ditto. * include/ruby/st.h (st_strcasecmp): declared. (st_strncasecmp): ditto. * st.c (type_strcasehash): use st_strcasecmp instead of strcasecmp. (st_strcasecmp): defined. (st_strncasecmp): ditto. * include/ruby/ruby.h: include include/ruby/encoding.h. (ISASCII): use rb_isascii. (ISPRINT): use rb_isprint. (ISSPACE): use rb_isspace. (ISUPPER): use rb_isupper. (ISLOWER): use rb_islower. (ISALNUM): use rb_isalnum. (ISALPHA): use rb_isalpha. (ISDIGIT): use rb_isdigit. (ISXDIGIT): use rb_isxdigit. (TOUPPER): defined. (TOLOWER): ditto. (STRCASECMP): ditto. (STRNCASECMP): ditto. * dir.c, encoding.c, file.c, hash.c, process.c, ruby.c, time.c, transcode.c, ext/readline/readline.c: use locale insensitive functions. [ruby-core:14662] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * load.c (rb_feature_p): returns loading path name too.nobu2007-12-241-0/+1
| | | | | | | | * load.c (search_required): returns path too if feature is being loaded. [ruby-dev:32048] [TODO: refactoring] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_alias): allow encodings multiple aliases.nobu2007-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | * encoding.c (rb_enc_find_index): search the encoding which has the given name and return its index if found, or -1. * st.c (type_strcasehash): case-insensitive string hash type. * string.c (rb_str_force_encoding): force encoding of self. this name comes from [ruby-dev:31894] by Martin Duerst. [ruby-dev:31744] * include/ruby/encoding.h (rb_enc_find_index, rb_enc_associate_index): prototyped. * include/ruby/encoding.h (rb_enc_isctype): direct interface to ctype. * include/ruby/st.h (st_init_strcasetable): prototyped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (struct st_table): make num_entries bitfieldakr2007-09-021-2/+2
| | | | | | | instead of num_bins for speed. num_entries has less access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e