Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'trunk' of github.com:ruby/ruby into trunk

  • Loading branch information...
commit 49d6e46a9f278207c32d2041bfb992c3292a1ce1 2 parents 854be35 + 1880558
@shyouhei authored
Showing with 51,538 additions and 24,663 deletions.
  1. +9 −9 .gdbinit
  2. +1 −9 .gitignore
  3. +11 −0 .travis.yml
  4. +7,628 −5 ChangeLog
  5. +37 −10 Makefile.in
  6. +99 −0 NEWS
  7. +65 −57 README
  8. +47 −11 README.EXT
  9. +20 −2 README.EXT.ja
  10. +77 −70 README.ja
  11. +25 −20 addr2line.c
  12. +27 −16 array.c
  13. +1 −1  atomic.h
  14. +1 −1  benchmark/bm_app_raise.rb
  15. +1 −1  benchmark/bm_app_strconcat.rb
  16. +5 −1 benchmark/bm_io_select2.rb
  17. +5 −1 benchmark/bm_io_select3.rb
  18. +1 −1  benchmark/bm_loop_whileloop.rb
  19. +1 −1  benchmark/bm_loop_whileloop2.rb
  20. +1 −1  benchmark/bm_so_concatenate.rb
  21. +1 −1  benchmark/bm_so_random.rb
  22. +1 −1  benchmark/bm_vm1_block.rb
  23. +1 −1  benchmark/bm_vm1_ensure.rb
  24. +1 −1  benchmark/bm_vm1_length.rb
  25. +18 −0 benchmark/bm_vm1_lvar_init.rb
  26. +5 −0 benchmark/bm_vm1_lvar_set.rb
  27. +1 −1  benchmark/bm_vm1_rescue.rb
  28. +1 −1  benchmark/bm_vm1_simplereturn.rb
  29. +1 −1  benchmark/bm_vm1_swap.rb
  30. +1 −1  benchmark/bm_vm2_array.rb
  31. +106 −0 benchmark/bm_vm2_bigarray.rb
  32. +5 −0 benchmark/bm_vm2_bighash.rb
  33. +1 −1  benchmark/bm_vm2_case.rb
  34. +1 −1  benchmark/bm_vm2_defined_method.rb
  35. +1 −1  benchmark/bm_vm2_eval.rb
  36. +1 −1  benchmark/bm_vm2_method.rb
  37. +1 −1  benchmark/bm_vm2_mutex.rb
  38. +1 −1  benchmark/bm_vm2_poly_method.rb
  39. +1 −1  benchmark/bm_vm2_poly_method_ov.rb
  40. +1 −1  benchmark/bm_vm2_proc.rb
  41. +18 −0 benchmark/bm_vm2_raise1.rb
  42. +18 −0 benchmark/bm_vm2_raise2.rb
  43. +1 −1  benchmark/bm_vm2_regexp.rb
  44. +1 −1  benchmark/bm_vm2_send.rb
  45. +22 −0 benchmark/bm_vm3_backtrace.rb
  46. +1 −1  benchmark/bm_vm3_clearmethodcache.rb
  47. +1 −1  benchmark/bm_vm_thread_create_join.rb
  48. +1 −1  benchmark/bm_vm_thread_mutex1.rb
  49. +1 −1  benchmark/bm_vm_thread_mutex2.rb
  50. +1 −1  benchmark/bm_vm_thread_mutex3.rb
  51. +1 −1  benchmark/bm_vm_thread_pass_flood.rb
  52. +1 −1  benchmark/bmx_temp.rb
  53. +8 −8 benchmark/driver.rb
  54. +51 −36 bignum.c
  55. +39 −1 bootstraptest/runner.rb
  56. +0 −1  bootstraptest/test_eval.rb
  57. +22 −0 bootstraptest/test_literal.rb
  58. +10 −15 class.c
  59. +102 −80 common.mk
  60. +365 −235 compile.c
  61. +8 −3 complex.c
  62. +378 −95 configure.in
  63. +91 −18 cont.c
  64. +2 −2 debug.c
  65. +39 −29 dir.c
  66. +27 −10 dln.c
  67. +0 −8 dln_find.c
  68. +2 −0  dmydln.c
  69. +5 −0 dmyext.c
  70. +2 −2 doc/ChangeLog-1.9.3
  71. +1 −1  doc/NEWS-1.9.3
  72. +76 −9 doc/re.rdoc
  73. +3 −0  enc/Makefile.in
  74. +5 −2 enc/ascii.c
  75. +9 −3 enc/big5.c
  76. +3 −1 enc/cp949.c
  77. +40 −42 enc/depend
  78. +2 −1  enc/emacs_mule.c
  79. +26 −0 enc/encinit.c.erb
  80. +269 −22 enc/euc_jp.c
  81. +3 −1 enc/euc_kr.c
  82. +3 −1 enc/euc_tw.c
  83. +3 −1 enc/gb18030.c
  84. +3 −1 enc/gbk.c
  85. +6 −1 enc/iso_2022_jp.h
  86. +3 −1 enc/iso_8859_1.c
  87. +3 −1 enc/iso_8859_10.c
  88. +3 −1 enc/iso_8859_11.c
  89. +3 −1 enc/iso_8859_13.c
  90. +3 −1 enc/iso_8859_14.c
  91. +3 −1 enc/iso_8859_15.c
  92. +3 −1 enc/iso_8859_16.c
  93. +3 −1 enc/iso_8859_2.c
  94. +3 −1 enc/iso_8859_3.c
  95. +3 −1 enc/iso_8859_4.c
  96. +3 −1 enc/iso_8859_5.c
  97. +3 −1 enc/iso_8859_6.c
  98. +3 −1 enc/iso_8859_7.c
  99. +3 −1 enc/iso_8859_8.c
  100. +3 −1 enc/iso_8859_9.c
  101. +3 −1 enc/koi8_r.c
  102. +3 −1 enc/koi8_u.c
  103. +86 −0 enc/make_encmake.rb
  104. +1,162 −0 enc/mktable.c
  105. +238 −45 enc/shift_jis.c
  106. +1,926 −0 enc/trans/JIS/JISX0213-1%UCS@BMP.src
  107. +60 −0 enc/trans/JIS/JISX0213-1%UCS@SIP.src
  108. +2,193 −0 enc/trans/JIS/JISX0213-2%UCS@BMP.src
  109. +311 −0 enc/trans/JIS/JISX0213-2%UCS@SIP.src
  110. +1,922 −0 enc/trans/JIS/UCS@BMP%JISX0213-1.src
  111. +2,189 −0 enc/trans/JIS/UCS@BMP%JISX0213-2.src
  112. +56 −0 enc/trans/JIS/UCS@SIP%JISX0213-1.src
  113. +307 −0 enc/trans/JIS/UCS@SIP%JISX0213-2.src
  114. +1 −2  enc/trans/big5.trans
  115. +1 −2  enc/trans/chinese.trans
  116. +1 −2  enc/trans/emoji.trans
  117. +1 −2  enc/trans/emoji_iso2022_kddi.trans
  118. +1 −2  enc/trans/emoji_sjis_docomo.trans
  119. +1 −2  enc/trans/emoji_sjis_kddi.trans
  120. +1 −2  enc/trans/emoji_sjis_softbank.trans
  121. +1 −2  enc/trans/escape.trans
  122. +1 −2  enc/trans/gb18030.trans
  123. +1 −2  enc/trans/gbk.trans
  124. +98 −0 enc/trans/iso-8859-16-tbl.rb
  125. +1 −2  enc/trans/iso2022.trans
  126. +1 −2  enc/trans/japanese.trans
  127. +13 −2 enc/trans/japanese_euc.trans
  128. +1 −2  enc/trans/japanese_sjis.trans
  129. +1 −2  enc/trans/korean.trans
  130. +2 −2 enc/trans/single_byte.trans
  131. +1 −2  enc/trans/utf8_mac.trans
  132. +1 −2  enc/trans/utf_16_32.trans
  133. +8 −1,937 enc/unicode.c
  134. +2,238 −0 enc/unicode/casefold.h
  135. +22,279 −17,423 enc/unicode/name2ctype.h
  136. +0 −4 enc/unicode/name2ctype.h.blt
  137. +3 −1 enc/us_ascii.c
  138. +5 −6 enc/utf_16be.c
  139. +5 −6 enc/utf_16le.c
  140. +5 −7 enc/utf_32be.c
  141. +5 −7 enc/utf_32le.c
  142. +6 −6 enc/utf_8.c
  143. +3 −1 enc/windows_1251.c
  144. +80 −0 enc/windows_31j.c
  145. +242 −18 encoding.c
  146. +343 −323 enum.c
  147. +668 −34 enumerator.c
  148. +223 −56 error.c
  149. +21 −17 eval.c
  150. +14 −1 eval_error.c
  151. +5 −0 eval_jump.c
  152. +14 −0 ext/-test-/exception/enc_raise.c
  153. +6 −0 ext/-test-/exception/extconf.rb
  154. +11 −0 ext/-test-/exception/init.c
  155. +16 −0 ext/-test-/iter/break.c
  156. +1 −0  ext/-test-/iter/extconf.rb
  157. +1 −0  ext/-test-/num2int/depend
  158. +1 −0  ext/-test-/num2int/extconf.rb
  159. +120 −0 ext/-test-/num2int/num2int.c
  160. +3 −0  ext/-test-/old_thread_select/extconf.rb
  161. +6 −0 ext/-test-/path_to_class/extconf.rb
  162. +15 −0 ext/-test-/path_to_class/path_to_class.c
  163. +1 −0  ext/-test-/printf/extconf.rb
  164. +31 −0 ext/-test-/printf/printf.c
  165. +1 −0  ext/-test-/st/numhash/extconf.rb
  166. +120 −0 ext/-test-/st/numhash/numhash.c
  167. +1 −0  ext/-test-/st/update/extconf.rb
  168. +34 −0 ext/-test-/st/update/update.c
  169. +8 −0 ext/-test-/string/modify.c
  170. +61 −0 ext/-test-/string/qsort.c
  171. +1 −0  ext/-test-/typeddata/extconf.rb
  172. +20 −0 ext/-test-/typeddata/typeddata.c
  173. +17 −0 ext/-test-/win32/dln/dlntest.c
  174. +36 −0 ext/-test-/win32/dln/extconf.rb
  175. +4 −0 ext/-test-/win32/dln/libdlntest.c
  176. +2 −0  ext/-test-/win32/dln/libdlntest.def
  177. +2 −0  ext/-test-/win32/fd_setsize/depend
  178. +3 −0  ext/-test-/win32/fd_setsize/extconf.rb
  179. +55 −0 ext/-test-/win32/fd_setsize/fd_setsize.c
  180. +0 −1  ext/.document
  181. +0 −1  ext/Setup
  182. +0 −1  ext/Setup.atheos
  183. +0 −1  ext/Setup.emx
  184. +50 −0 ext/Setup.nacl
  185. +0 −1  ext/Setup.nt
  186. +1 −1  ext/bigdecimal/README
  187. +106 −41 ext/bigdecimal/bigdecimal.c
  188. +14 −1 ext/bigdecimal/bigdecimal.h
  189. +0 −1  ext/bigdecimal/lib/bigdecimal/math.rb
  190. +91 −29 ext/curses/curses.c
  191. +96 −16 ext/curses/extconf.rb
  192. +1 −1  ext/curses/rain.rb
  193. +86 −27 ext/date/date_core.c
  194. +45 −25 ext/date/date_parse.c
  195. +580 −1,106 ext/date/date_strftime.c
  196. +14 −14 ext/date/date_strptime.c
  197. +136 −27 ext/dbm/dbm.c
  198. +221 −24 ext/dbm/extconf.rb
  199. +8 −0 ext/digest/digest.c
  200. +3 −1 ext/digest/md5/extconf.rb
  201. +3 −0  ext/digest/md5/md5init.c
  202. +3 −1 ext/digest/rmd160/extconf.rb
  203. +7 −3 ext/digest/rmd160/rmd160.c
  204. +3 −0  ext/digest/rmd160/rmd160init.c
  205. +3 −1 ext/digest/sha1/extconf.rb
  206. +3 −0  ext/digest/sha1/sha1init.c
  207. +3 −1 ext/digest/sha2/extconf.rb
  208. +3 −3 ext/digest/sha2/lib/sha2.rb
  209. +7 −7 ext/digest/sha2/sha2.c
  210. +9 −5 ext/dl/callback/mkcallback.rb
  211. +6 −1 ext/dl/cfunc.c
  212. +1 −10 ext/dl/cptr.c
  213. +138 −16 ext/dl/dl.c
  214. +11 −20 ext/dl/dl.h
  215. +15 −1 ext/dl/extconf.rb
  216. +2 −0  ext/dl/handle.c
  217. +10 −0 ext/dl/lib/dl/cparser.rb
  218. +5 −1 ext/dl/lib/dl/types.rb
  219. +2 −2 ext/dl/lib/dl/value.rb
  220. +4 −4 ext/etc/etc.c
  221. +100 −48 ext/extmk.rb
  222. +33 −4 ext/fiddle/closure.c
  223. +33 −27 ext/fiddle/conversions.c
  224. +2 −1  ext/fiddle/conversions.h
  225. +16 −2 ext/fiddle/extconf.rb
  226. +64 −1 ext/fiddle/fiddle.c
  227. +9 −0 ext/fiddle/fiddle.h
  228. +39 −9 ext/gdbm/gdbm.c
  229. +0 −104 ext/iconv/charset_alias.rb
  230. +0 −2  ext/iconv/depend
  231. +0 −54 ext/iconv/extconf.rb
  232. +0 −1,256 ext/iconv/iconv.c
  233. +0 −53 ext/iconv/mkwrapper.rb
  234. +165 −31 ext/io/console/console.c
  235. +3 −0  ext/io/wait/wait.c
  236. +164 −0 ext/json/fbuffer/fbuffer.h
  237. +1 −1  ext/json/generator/depend
  238. +1 −7 ext/json/generator/extconf.rb
  239. +73 −139 ext/json/generator/generator.c
  240. +5 −43 ext/json/generator/generator.h
  241. +21 −0 ext/json/lib/json/add/bigdecimal.rb
  242. +9 −241 ext/json/lib/json/add/core.rb
  243. +34 −0 ext/json/lib/json/add/date.rb
  244. +50 −0 ext/json/lib/json/add/date_time.rb
  245. +31 −0 ext/json/lib/json/add/exception.rb
  246. +31 −0 ext/json/lib/json/add/ostruct.rb
  247. +29 −0 ext/json/lib/json/add/range.rb
  248. +30 −0 ext/json/lib/json/add/regexp.rb
  249. +30 −0 ext/json/lib/json/add/struct.rb
  250. +25 −0 ext/json/lib/json/add/symbol.rb
  251. +35 −0 ext/json/lib/json/add/time.rb
  252. +41 −5 ext/json/lib/json/common.rb
  253. +6 −0 ext/json/lib/json/ext.rb
  254. +39 −0 ext/json/lib/json/generic_object.rb
  255. +1 −1  ext/json/lib/json/version.rb
  256. +1 −1  ext/json/parser/depend
  257. +0 −7 ext/json/parser/extconf.rb
  258. +104 −90 ext/json/parser/parser.c
  259. +2 −7 ext/json/parser/parser.h
  260. +22 −5 ext/json/parser/parser.rl
  261. +4 −4 ext/objspace/objspace.c
  262. +21 −0 ext/openssl/deprecation.rb
  263. +27 −17 ext/openssl/extconf.rb
  264. +2 −1  ext/openssl/lib/openssl/buffering.rb
  265. +9 −1 ext/openssl/lib/openssl/ssl.rb
  266. +13 −4 ext/openssl/ossl.c
  267. +28 −16 ext/openssl/ossl_asn1.c
  268. +1 −1  ext/openssl/ossl_bio.c
  269. +210 −23 ext/openssl/ossl_cipher.c
  270. +1 −1  ext/openssl/ossl_digest.c
  271. +29 −11 ext/openssl/ossl_engine.c
  272. +135 −3 ext/openssl/ossl_ns_spki.c
  273. +96 −8 ext/openssl/ossl_pkcs5.c
  274. +6 −3 ext/openssl/ossl_pkcs7.c
  275. +3 −1 ext/openssl/ossl_pkey.c
  276. +1 −1  ext/openssl/ossl_pkey.h
  277. +1 −1  ext/openssl/ossl_pkey_dsa.c
  278. +6 −0 ext/openssl/ossl_pkey_ec.c
  279. +6 −6 ext/openssl/ossl_pkey_rsa.c
  280. +191 −65 ext/openssl/ossl_ssl.c
  281. +2 −1  ext/openssl/ossl_x509cert.c
  282. +11 −4 ext/openssl/ossl_x509name.c
  283. +39 −0 ext/openssl/ossl_x509store.c
  284. +0 −13 ext/openssl/ruby_missing.h
  285. +4 −1 ext/pathname/lib/pathname.rb
  286. +25 −5 ext/pathname/pathname.c
  287. +1 −1  ext/psych/emitter.c
  288. +1 −1  ext/psych/extconf.rb
  289. +86 −21 ext/psych/lib/psych.rb
  290. +2 −0  ext/psych/lib/psych/core_ext.rb
  291. +22 −0 ext/psych/lib/psych/handlers/document_stream.rb
  292. +0 −6 ext/psych/lib/psych/json.rb
  293. +2 −2 ext/psych/lib/psych/json/yaml_events.rb
  294. +4 −0 ext/psych/lib/psych/parser.rb
  295. +7 −3 ext/psych/lib/psych/scalar_scanner.rb
  296. +3 −2 ext/psych/lib/psych/syntax_error.rb
  297. +3 −1 ext/psych/lib/psych/tree_builder.rb
  298. +58 −16 ext/psych/lib/psych/visitors/to_ruby.rb
  299. +60 −11 ext/psych/lib/psych/visitors/yaml_tree.rb
  300. +223 −58 ext/psych/parser.c
Sorry, we could not display the entire diff because too many files (802) changed.
View
18 .gdbinit
@@ -625,18 +625,18 @@ define rb_numtable_entry
set $rb_numtable_key = 0
set $rb_numtable_rec = 0
if $rb_numtable_tbl->entries_packed
- set $rb_numtable_p = $rb_numtable_tbl->bins
- while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->bins+$rb_numtable_tbl->num_entries
- if (st_data_t)$rb_numtable_p[0] == $rb_numtable_id
- set $rb_numtable_key = (st_data_t)$rb_numtable_p[0]
- set $rb_numtable_rec = (st_data_t)$rb_numtable_p[1]
+ set $rb_numtable_p = $rb_numtable_tbl->as.packed.bins
+ while $rb_numtable_p && $rb_numtable_p < $rb_numtable_tbl->as.packed.bins+$rb_numtable_tbl->num_entries
+ if $rb_numtable_p.k == $rb_numtable_id
+ set $rb_numtable_key = $rb_numtable_p.k
+ set $rb_numtable_rec = $rb_numtable_p.v
set $rb_numtable_p = 0
else
- set $rb_numtable_p = $rb_numtable_p + 2
+ set $rb_numtable_p = $rb_numtable_p + 1
end
end
else
- set $rb_numtable_p = $rb_numtable_tbl->bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
+ set $rb_numtable_p = $rb_numtable_tbl->as.big.bins[$rb_numtable_id % $rb_numtable_tbl->num_bins]
while $rb_numtable_p
if $rb_numtable_p->key == $rb_numtable_id
set $rb_numtable_key = $rb_numtable_p->key
@@ -731,8 +731,8 @@ define rb_ps_vm
if $ps_threads->entries_packed
set $ps_threads_i = 0
while $ps_threads_i < $ps_threads->num_entries
- set $ps_threads_key = (st_data_t)$ps_threads->bins[$ps_threads_i * 2]
- set $ps_threads_val = (st_data_t)$ps_threads->bins[$ps_threads_i * 2 + 1]
+ set $ps_threads_key = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].key
+ set $ps_threads_val = (st_data_t)$ps_threads->as.packed.entries[$ps_threads_i].val
rb_ps_thread $ps_threads_key $ps_threads_val
set $ps_threads_i = $ps_threads_i + 1
end
View
10 .gitignore
@@ -51,7 +51,6 @@ y.tab.c
/configure
/doc/capi
/enc.mk
-/enc/trans/*.c
/encdb.h
/exts.mk
/goruby
@@ -84,6 +83,7 @@ y.tab.c
/tmp
/transdb.h
/uncommon.mk
+/verconf.h
/web
/yasmdata.rb
@@ -96,18 +96,10 @@ y.tab.c
# /ext/
/ext/extinit.c
-# /ext/dl/
-/ext/dl/*.func
-
# /ext/dl/callback/
-/ext/dl/callback/*.func
/ext/dl/callback/callback-*.c
/ext/dl/callback/callback.c
-# /ext/iconv/
-/ext/iconv/config.charset
-/ext/iconv/iconv.rb
-
# /ext/ripper/
/ext/ripper/eventids1.c
/ext/ripper/eventids2table.c
View
11 .travis.yml
@@ -0,0 +1,11 @@
+# no installation...
+
+# 1.9.1 is OK, since it is the most adopted version
+install: "sudo apt-get build-dep ruby1.9.1"
+before_script: autoconf
+script: "./configure && make all test"
+
+branches:
+ only:
+ - trunk
+ - ruby_1_9_3
View
7,633 ChangeLog
7,628 additions, 5 deletions not shown
View
47 Makefile.in
@@ -1,5 +1,7 @@
SHELL = /bin/sh
NULLCMD = @NULLCMD@
+n=$(NULLCMD)
+ECHO1 = $(V:1=@$n)
RUNCMD = $(SHELL)
CHDIR = @CHDIR@
exec = exec
@@ -10,9 +12,11 @@ NULL = /dev/null
srcdir = @srcdir@
top_srcdir = $(srcdir)
hdrdir = $(srcdir)/include
+PLATFORM_DIR = @PLATFORM_DIR@
CC = @CC@
CPP = @CPP@
+LD = @LD@
YACC = bison
PURIFY =
AUTOCONF = autoconf
@@ -48,7 +52,7 @@ empty =
OUTFLAG = @OUTFLAG@$(empty)
COUTFLAG = @COUTFLAG@$(empty)
ARCH_FLAG = @ARCH_FLAG@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ $(ARCH_FLAG)
cflags = @cflags@
optflags = @optflags@
debugflags = @debugflags@
@@ -57,31 +61,38 @@ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir)
XCFLAGS = @XCFLAGS@
CPPFLAGS = @CPPFLAGS@ $(INCFLAGS)
LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
-EXTLDFLAGS =
+EXTLDFLAGS = @EXTLDFLAGS@
XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS)
-EXTLIBS =
+EXTLIBS =
LIBS = @LIBS@ $(EXTLIBS)
MISSING = @LIBOBJS@ @ALLOCA@
LDSHARED = @LIBRUBY_LDSHARED@
-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS) $(ARCH_FLAG)
+DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
SOLIBS = @SOLIBS@
MAINLIBS = @MAINLIBS@
ARCHMINIOBJS = @MINIOBJS@
+ENCOBJS = @ENCOBJS@
+EXTOBJS = @EXTOBJS@
BUILTIN_ENCOBJS = @BUILTIN_ENCOBJS@
BUILTIN_TRANSSRCS = @BUILTIN_TRANSSRCS@
BUILTIN_TRANSOBJS = @BUILTIN_TRANSOBJS@
+POSTLINK = @POSTLINK@
RUBY_BASE_NAME=@RUBY_BASE_NAME@
RUBY_PROGRAM_VERSION=@RUBY_PROGRAM_VERSION@
RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@
RUBY_SO_NAME=@RUBY_SO_NAME@
+RUBY_RELEASE_DATE=@RUBY_RELEASE_DATE@
EXEEXT = @EXEEXT@
+LIBEXT = @LIBEXT@
PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT)
RUBY = $(RUBY_INSTALL_NAME)
MINIRUBY = @MINIRUBY@\
$(MINIRUBYOPT)
RUNRUBY = @RUNRUBY@ $(RUNRUBYOPT) -- $(RUN_OPTS)
XRUBY = @XRUBY@
+BTESTRUBY = @BTESTRUBY@\
+ $(MINIRUBYOPT)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -144,6 +155,9 @@ INSTALLED_LIST= .installed.list
MKMAIN_CMD = mkmain.sh
+NEWLINE_C = newline.c
+MINIPRELUDE_C = miniprelude.c
+
SRC_FILE = $<
MESSAGE_BEGIN = @for line in
@@ -167,7 +181,8 @@ miniruby$(EXEEXT):
$(PROGRAM):
@$(RM) $@
$(ECHO) linking $@
- $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(OUTFLAG)$@
+ $(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
+ $(Q) $(POSTLINK)
# We must `rm' the library each time this rule is invoked because "updating" a
# MAB library on Apple/NeXT (see --enable-fat-binary in configure) is not
@@ -177,11 +192,14 @@ $(LIBRUBY_A):
$(ECHO) linking static-library $@
$(Q) $(AR) $(ARFLAGS) $@ $(OBJS) $(DMYEXT)
@-$(RANLIB) $@ 2> /dev/null || true
+ $(ECHO) verifying static-library $@
+ @$(PURIFY) $(CC) $(XLDFLAGS) $(MAINOBJ) $(LIBRUBY_A) $(MAINLIBS) $(EXTLIBS) $(LIBS) $(OUTFLAG)conftest$(EXEEXT) $(LDFLAGS)
+ @$(RM) conftest$(EXEEXT) conftest.c
$(LIBRUBY_SO):
@-$(PRE_LIBRUBY_UPDATE)
$(ECHO) linking shared-library $@
- $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(OUTFLAG)$@
+ $(Q) $(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) $(EXTSOLIBS) $(OUTFLAG)$@
-$(Q) $(OBJCOPY) -w -L '$(SYMBOL_PREFIX)Init_*' -L '$(SYMBOL_PREFIX)*_threadptr_*' $@
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
File.symlink "$(LIBRUBY_SO)", link}' \
@@ -234,7 +252,8 @@ config.status-args = ./config.status --recheck
reconfig-exec-0 = exec 3>&1; exit `exec 4>&1; { "$$@" 3>&- 4>&-; echo $$? 1>&4; } | fgrep -v '(cached)' 1>&3`
reconfig-exec-1 = set -x; "$$@"
-reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in
+reconfig config.status: $(srcdir)/configure $(srcdir)/enc/Makefile.in \
+ $(srcdir)/include/ruby/version.h
@PWD= MINIRUBY="$(MINIRUBY)"; export MINIRUBY; \
set $(SHELL) $($@-args); $(reconfig-exec-$(V))
@@ -275,7 +294,7 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
trap '$(RM) $@-1.h $@-2.h' 0 && \
set -x; \
sed '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/d' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-1.h && \
- gperf $(NAME2CTYPE_OPTIONS) < $? > $@-2.h && \
+ sed -e '/^#ifdef USE_UNICODE_PROPERTIES/,/^#endif/{' -e '/^#/d' -e '}' $? | gperf $(NAME2CTYPE_OPTIONS) > $@-2.h && \
diff -DUSE_UNICODE_PROPERTIES $@-1.h $@-2.h > $@.tmp || :; \
$(MV) $@.tmp $@ && \
$(CP) $? $(?:.kwd=.src) && \
@@ -299,13 +318,14 @@ enc/unicode/name2ctype.h: enc/unicode/name2ctype.kwd
$(Q) $(CPP) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -E $< > $@
clean-local::
- $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output
+ $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \
+ enc/encinit.c enc/encinit.$(OBJEXT)
-$(Q)$(RM) $(pkgconfig_DATA)
distclean-local::
$(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile
-$(Q)$(RM) run.gdb
- -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h
+ -$(Q)$(RM) $(INSTALLED_LIST) $(arch_hdrdir)/ruby/config.h verconf.h
-$(Q)$(RMDIRS) $(arch_hdrdir)/ruby 2> /dev/null || true
clean-ext distclean-ext realclean-ext::
@@ -323,8 +343,10 @@ clean-ext distclean-ext realclean-ext::
$(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
esac; \
done
+ -$(Q)$(RM) ext/extinit.$(OBJEXT)
distclean-ext realclean-ext::
+ -$(Q)$(RM) ext/extinit.c
-$(Q)$(RMDIR) ext 2> /dev/null || true
clean-extout:
@@ -342,11 +364,16 @@ clean-capi distclean-capi realclean-capi:
@echo $(@:-capi=ing) capi
$(Q)$(RMALL) $(CAPIOUT)
+clean-platform:
+ @$(RM) $(PLATFORM_D)
+ -$(Q) $(RMDIR) $(PLATFORM_DIR) 2> /dev/null || true
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
$(ECHO) compiling $@
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c ext/extinit.c
+enc/encinit.$(OBJEXT): enc/encinit.c $(SETUP)
+
up::
@$(CHDIR) "$(srcdir)" && LC_TIME=C exec $(VCSUP)
View
99 NEWS
@@ -11,24 +11,67 @@ with all sufficient information, see the ChangeLog file.
== Changes since the 1.9.3 release
=== C API updates
+* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
+
=== Library updates (outstanding ones only)
* builtin classes
+ * Enumerable
+ * added method:
+ * added Enumerable#lazy method for lazy enumeration.
+
+ * ENV
+ * aliased method:
+ * ENV.to_h is a new alias for ENV.to_hash
+
+ * Hash
+ * added method:
+ * added Hash#to_h as explicit conversion method, like Array#to_a.
+ * extended method:
+ * Hash#default_proc= can be passed nil to clear the default proc.
+
* Kernel
+ * added method:
+ * added Kernel#Hash conversion method like Array() or Float().
* extended method:
* Kernel#warn accepts multiple args in like puts.
+ * Kernel#caller accepts second optional argument `n' which specify
+ required caller size.
+ * incompatible changes:
+ * system() and exec() closes non-standard file descriptors
+ (The default of :close_others option is changed to true by default.)
+ * respond_to? against a protected method now returns false unless
+ the second argument is true.
+
+ * LoadError
+ * added method:
+ * added LoadError#path method to return the file name that could not be
+ loaded.
+
+ * NilClass
+ * added method:
+ * added nil.to_h which returns {}
* Signal
* incompatible changes:
* Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
are specified.
+ * Struct
+ * added method:
+ * added Struct#to_h returning values with keys corresponding to the
+ instance variable names.
+
* Time
* change return value:
* Time#to_s returned encoding defaults to US-ASCII but automatically
transcodes to Encoding.default_internal if it is set.
+ * Fiber
+ * incompatible changes:
+ * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
+
* net/imap
* new methods:
* Net::IMAP.default_port
@@ -37,9 +80,65 @@ with all sufficient information, see the ChangeLog file.
* Net::IMAP.default_ssl_port
* Net::IMAP.default_imaps_port
+* ostruct
+ * new methods:
+ * OpenStruct#to_h converts the struct to a hash.
+
+* pathname
+ * extended method:
+ * Pathname#find returns an enumerator if no block is given.
+
+* resolv
+ * new methods:
+ * Resolv::DNS#timeouts=
+ * Resolv::DNS::Config#timeouts=
+
+* shellwords
+ * Shellwords#shellescape() now stringifies the given object using to_s.
+ * Shellwords#shelljoin() accepts non-string objects in the given
+ array, each of which is stringified using to_s.
+
+* syslog
+ * Added Syslog::Logger which provides a Logger API atop Syslog.
+ * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
+ are introduced for easy detection of available constants on a
+ running system.
+
+* lib/tmpdir.rb
+ * incompatible changes:
+ * Dir.mktmpdir uses FileUtils.remove_entry instead of
+ FileUtils.remove_entry_secure. This means that applications should not
+ change the permission of the created temporary directory to make
+ accessible from other users.
+
+* zlib
+ * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
+
+* openssl
+ * Consistently raise an error when trying to encode nil values. All instances
+ of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
+ instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
+ raise NoMethodError in the same case. Constructing such values is still
+ permitted.
+
=== Language changes
=== Compatibility issues (excluding feature bug fixes)
* Signal.trap
See above.
+
+ * Merge Onigmo.
+ https://github.com/k-takata/Onigmo
+
+ * The :close_others option is true by default for system() and exec().
+ Also, the close-on-exec flag is set by default for all new file descriptors.
+ This means file descriptors doesn't inherit to spawned process unless
+ explicitly requested such as system(..., fd=>fd).
+
+ * Kernel#respond_to? against a protected method now returns false
+ unless the second argument is true.
+
+ * Dir.mktmpdir in lib/tmpdir.rb
+
+ See above.
View
122 README
@@ -1,4 +1,4 @@
-* What's Ruby
+= What's Ruby
Ruby is the interpreted scripting language for quick and
easy object-oriented programming. It has many features to
@@ -6,46 +6,53 @@ process text files and to do system management tasks (as in
Perl). It is simple, straight-forward, and extensible.
-* Features of Ruby
+== Features of Ruby
- + Simple Syntax
- + *Normal* Object-Oriented features(ex. class, method calls)
- + *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
- + Operator Overloading
- + Exception Handling
- + Iterators and Closures
- + Garbage Collection
- + Dynamic Loading of Object files(on some architecture)
- + Highly Portable (works on many Unix-like/POSIX compatible platforms
+* Simple Syntax
+* *Normal* Object-Oriented features(ex. class, method calls)
+* *Advanced* Object-Oriented features(ex. Mix-in, Singleton-method)
+* Operator Overloading
+* Exception Handling
+* Iterators and Closures
+* Garbage Collection
+* Dynamic Loading of Object files(on some architecture)
+* Highly Portable (works on many Unix-like/POSIX compatible platforms
as well as Windows, Mac OS X, BeOS etc.)
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatforms
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatforms
-* How to get Ruby
+== How to get Ruby
The Ruby distribution files can be found in the following FTP site:
- ftp://ftp.ruby-lang.org/pub/ruby/
+ftp://ftp.ruby-lang.org/pub/ruby/
The trunk of the Ruby source tree can be checked out with the
following command:
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk/ ruby
+Or if you are using git then use following command:
+
+ $ git clone git://github.com/ruby/ruby.git
+
There are some other branches under development. Try the following
command and see the list of branches:
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+Or if you are using git then use following command:
+
+ $ git ls-remote git://github.com/ruby/ruby.git
-* Ruby home-page
+== Ruby home-page
The URL of the Ruby home-page is:
- http://www.ruby-lang.org/
+http://www.ruby-lang.org/
-* Mailing list
+== Mailing list
There is a mailing list to talk about Ruby.
To subscribe this list, please send the following phrase
@@ -54,65 +61,65 @@ To subscribe this list, please send the following phrase
e.g.
subscribe Joseph Smith
-in the mail body (not subject) to the address <ruby-talk-ctl@ruby-lang.org>.
+in the mail body (not subject) to the address <mailto:ruby-talk-ctl@ruby-lang.org>.
-* How to compile and install
+== How to compile and install
This is what you need to do to compile and install Ruby:
- 1. If ./configure does not exist or is older than configure.in,
+1. If +./configure+ does not exist or is older than configure.in,
run autoconf to (re)generate configure.
- 2. Run ./configure, which will generate config.h and Makefile.
+2. Run +./configure+, which will generate config.h and Makefile.
Some C compiler flags may be added by default depending on your
- environment. Specify optflags=.. and warnflags=.. as necessary
- to override them.
+ environment. Specify <tt>optflags=..</tt> and <tt>warnflags=..</tt> as
+ necessary to override them.
- 3. Edit defines.h if you need. Usually this step will not be needed.
+3. Edit +defines.h+ if you need. Usually this step will not be needed.
- 4. Remove comment mark(#) before the module names from ext/Setup (or
+4. Remove comment mark(<tt>#</tt>) before the module names from +ext/Setup+ (or
add module names if not present), if you want to link modules
statically.
If you don't want to compile non static extension modules
(probably on architectures which does not allow dynamic loading),
- remove comment mark from the line "#option nodynamic" in
- ext/Setup.
+ remove comment mark from the line "<tt>#option nodynamic</tt>" in
+ +ext/Setup+.
- 5. Run make.
+5. Run +make+.
- 6. Optionally, run 'make test' to check whether the compiled Ruby
- interpreter works well. If you see the message "test succeeded",
+6. Optionally, run '<tt>make check</tt>' to check whether the compiled Ruby
+ interpreter works well. If you see the message "<tt>check succeeded</tt>",
your ruby works as it should (hopefully).
- 7. Run 'make install'
+7. Run '<tt>make install</tt>'
This command will create following directories and install files
onto them.
- * ${DESTDIR}${prefix}/bin
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib
- * ${DESTDIR}${prefix}/lib/ruby
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/share/man/man1
- * ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system
-
- If Ruby's API version is `x.y.z', the ((|${MAJOR}|)) is `x', the
- ((|${MINOR}|)) is `y', and the ((|${TEENY}|)) is `z'.
-
- NOTE: teeny of the API version may be different from one of
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ If Ruby's API version is '_x.y.z_', the <tt>${MAJOR}</tt> is '_x_', the
+ <tt>${MINOR}</tt> is '_y_', and the <tt>${TEENY}</tt> is '_z_'.
+
+ *NOTE*: teeny of the API version may be different from one of
Ruby's program version
You may have to be a super user to install ruby.
@@ -121,20 +128,21 @@ If you fail to compile ruby, please send the detailed error report with
the error log and machine/OS type, to help others.
-* Copying
+== Copying
-See the file COPYING.
+See the file +COPYING+.
-* The Author
+== The Author
Feel free to send comments and bug reports to the author. Here is the
author's latest mail address:
- matz@netlab.jp
+<mailto:matz@ruby-lang.org>
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
View
58 README.EXT
@@ -284,6 +284,9 @@ listed below:
rb_ary_shift(VALUE ary)
rb_ary_unshift(VALUE ary, VALUE val)
+ rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ Appends len elements of objects from ptr to the array.
2. Extending Ruby with C
@@ -449,12 +452,14 @@ argument by using
rb_to_id(VALUE symbol)
rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
These functions try to convert the argument to a String if it was not
-a Symbol nor a String. The latter function stores the converted
+a Symbol nor a String. The second function stores the converted
result into *name, and returns 0 if the string is not a known symbol.
After this function returned a non-zero value, *name is always a
Symbol or a String, otherwise it is a String if the result is 0.
+The third function takes NUL-terminated C string, not Ruby VALUE.
You can convert C ID to Ruby Symbol by using
@@ -750,9 +755,23 @@ need to put
at the top of the file. You can use the functions below to check
various conditions.
- have_library(lib, func): check whether library containing function exists.
- have_func(func, header): check whether function exists
- have_header(header): check whether header file exists
+ have_macro(macro[, headers[, opt]]): check whether macro is defined
+ have_library(lib[, func[, headers[, opt]]]): check whether library containing function exists
+ find_library(lib[, func, *paths]): find library from paths
+ have_func(func[, headers[, opt]): check whether function exists
+ have_var(var[, headers[, opt]]): check whether variable exists
+ have_header(header[, preheaders[, opt]]): check whether header file exists
+ find_header(header, *paths): find header from paths
+ have_framework(fw): check whether framework exists (for MacOS X)
+ have_struct_member(type, member[, headers]): check whether struct has member
+ have_type(type[, headers[, opt]]): check whether type exists
+ find_type(type, opt, *headers): check whether type exists in headers
+ have_const(const[, headers[, opt]]): check whether constant is defined
+ check_sizeof(type[, headers[, opts]]): check size of type
+ check_signedness(type[, headers[, opts]]): check signedness of type
+ convertible_int(type[, headers[, opts]]): find convertible integer type
+ find_executable(bin[, path]): find excutable file path
+ create_header(header): generate configured header
create_makefile(target): generate Makefile
The value of the variables below will affect the Makefile.
@@ -1248,6 +1267,8 @@ Calls the function func with arg as the argument. If no exception
occured during func, it returns the result of func and *state is zero.
Otherwise, it returns Qnil and sets *state to nonzero. If state is
NULL, it is not set in both cases.
+You have to clear the error info with rb_set_errinfo(Qnil) when
+ignoring the caught exception.
void rb_jump_tag(int state)
@@ -1255,6 +1276,17 @@ Continues the exception caught by rb_protect() and rb_eval_string_protect().
state must be the returned value from those functions. This function
never return to the caller.
+ void rb_iter_break()
+
+Exits from the current innermost block. This function never return to
+the caller.
+
+ void rb_iter_break_value(VALUE value)
+
+Exits from the current innermost block with the value. The block will
+return the given argument value. This function never return to the
+caller.
+
** Exceptions and Errors
void rb_warn(const char *fmt, ...)
@@ -1379,12 +1411,12 @@ Appendix C. Functions Available in extconf.rb
These functions are available in extconf.rb:
- have_macro(macro, headers)
+ have_macro(macro, headers, opt)
Checks whether macro is defined with header. Returns true if the macro
is defined.
- have_library(lib, func)
+ have_library(lib, func, opt)
Checks whether the library exists, containing the specified function.
Returns true if the library exists.
@@ -1394,19 +1426,23 @@ Returns true if the library exists.
Checks whether a library which contains the specified function exists in
path. Returns true if the library exists.
- have_func(func, header)
+ have_func(func, headers, opt)
Checks whether func exists with header. Returns true if the function
exists. To check functions in an additional library, you need to
check that library first using have_library().
+The func shall be either mere function name or function name with
+arguments.
+Example:
+ have_func("LONG2NUM(0)")
- have_var(var, header)
+ have_var(var, header, opt)
Checks whether var exists with header. Returns true if the variable
exists. To check variables in an additional library, you need to
check that library first using have_library().
- have_header(header)
+ have_header(header, preheaders, opt)
Checks whether header exists. Returns true if the header file exists.
@@ -1415,12 +1451,12 @@ Checks whether header exists. Returns true if the header file exists.
Checks whether header exists in path. Returns true if the header file
exists.
- have_struct_member(type, member, header)
+ have_struct_member(type, member, headers, opt)
Checks whether type has member with header. Returns true if the type
is defined and has the member.
- have_type(type, header, opt)
+ have_type(type, headers, opt)
Checks whether type is defined with header. Returns true if the type
is defined.
View
22 README.EXT.ja
@@ -312,6 +312,10 @@ Rubyが用意している関数を用いてください.
rb_ary_shift(VALUE ary)
rb_ary_unshift(VALUE ary, VALUE val)
+ rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+
+ 配列aryにptrからlen個のオブジェクトを追加する.
+
2.Rubyの機能を使う
原理的にRubyで書けることはCでも書けます.RubyそのものがCで記
@@ -496,12 +500,14 @@ IDとは変数名,メソッド名を表す整数です.Rubyの中では
rb_to_id(VALUE symbol)
rb_check_id(volatile VALUE *name)
+ rb_check_id_cstr(const char *name, long len, rb_encoding *enc)
もし引数がシンボルでも文字列でもなければ、to_strメソッドで文
-字列に変換しようとします.後者の関数はその変換結果を*nameに保
+字列に変換しようとします.第二の関数はその変換結果を*nameに保
存し,その名前が既知のシンボルでない場合は0を返します.この関
数が0以外を返した場合は*nameは常にシンボルか文字列であり、0を
-返した場合は常に文字列です.
+返した場合は常に文字列です.第三の関数はRubyの文字列ではなく
+NUL終端されたCの文字列を使います.
2.2.3 CからRubyのメソッドを呼び出す
@@ -1336,6 +1342,8 @@ VALUE rb_protect(VALUE (*func) (VALUE), VALUE arg, int *state)
関数funcをargを引数として実行し, 例外が発生しなければその戻
り値を返す.例外が発生した場合は, *stateに非0をセットして
Qnilを返す.
+ rb_jump_tag()を呼ばずに捕捉した例外を無視する場合には,
+ rb_set_errinfo(Qnil)でエラー情報をクリアしなければならない.
void rb_jump_tag(int state)
@@ -1343,6 +1351,16 @@ void rb_jump_tag(int state)
送する.stateはそれらの関数から返された値でなければならない.
この関数は直接の呼び出し元に戻らない.
+void rb_iter_break()
+
+ 現在の最も内側のブロックを終了する.この関数は直接の呼び出
+ し元に戻らない.
+
+void rb_iter_break_value(VALUE value)
+
+ 現在の最も内側のブロックをvalueで終了する.ブロックは引数で
+ 与えられたvalueを返す.この関数は直接の呼び出し元に戻らない.
+
** 例外・エラー
void rb_warning(const char *fmt, ...)
View
147 README.ja
@@ -1,4 +1,4 @@
-* Rubyとは
+= Rubyとは
Rubyはシンプルかつ強力なオブジェクト指向スクリプト言語です.
Rubyは最初から純粋なオブジェクト指向言語として設計されていま
@@ -10,29 +10,29 @@ Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい
によって,より分かりやすいプログラミングが出来ます.
-* Rubyの特長
+== Rubyの特長
- + シンプルな文法
- + 普通のオブジェクト指向機能(クラス,メソッドコールなど)
- + 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
- + 演算子オーバーロード
- + 例外処理機能
- + イテレータとクロージャ
- + ガーベージコレクタ
- + ダイナミックローディング (アーキテクチャによる)
- + 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で
+* シンプルな文法
+* 普通のオブジェクト指向機能(クラス,メソッドコールなど)
+* 特殊なオブジェクト指向機能(Mixin, 特異メソッドなど)
+* 演算子オーバーロード
+* 例外処理機能
+* イテレータとクロージャ
+* ガーベージコレクタ
+* ダイナミックローディング (アーキテクチャによる)
+* 移植性が高い.多くのUnix-like/POSIX互換プラットフォーム上で
動くだけでなく,Windows, Mac OS X,BeOSなどの上でも動く
- cf. http://redmine.ruby-lang.org/wiki/ruby-19/SupportedPlatformsJa
+ cf. http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/SupportedPlatformsJa
-* 入手法
+== 入手法
-** FTPで
+=== FTPで
以下の場所においてあります.
- ftp://ftp.ruby-lang.org/pub/ruby/
+ftp://ftp.ruby-lang.org/pub/ruby/
-** Subversionで
+=== Subversionで
開発先端のソースコードは次のコマンドで取得できます.
@@ -42,21 +42,27 @@ Rubyはテキスト処理関係の能力などに優れ,Perlと同じくらい
$ svn ls http://svn.ruby-lang.org/repos/ruby/branches/
+=== Gitで
-* ホームページ
+SubversionのミラーをGitHubに公開しています.
+以下のコマンドでリポジトリを取得できます.
+
+ $ git clone git://github.com/ruby/ruby.git
+
+== ホームページ
RubyのホームページのURLは
- http://www.ruby-lang.org/
+http://www.ruby-lang.org/
です.
-* メーリングリスト
+== メーリングリスト
Rubyのメーリングリストがあります。参加希望の方は
- ruby-list-ctl@ruby-lang.org
+mailto:ruby-list-ctl@ruby-lang.org
まで本文に
@@ -68,7 +74,7 @@ Ruby開発者向けメーリングリストもあります。こちらではruby
グ、将来の仕様拡張など実装上の問題について議論されています。
参加希望の方は
- ruby-dev-ctl@ruby-lang.org
+mailto:ruby-dev-ctl@ruby-lang.org
までruby-listと同様の方法でメールしてください。
@@ -78,91 +84,91 @@ Ruby拡張モジュールについて話し合うruby-extメーリングリス
はどれも同じです。
-* コンパイル・インストール
+== コンパイル・インストール
以下の手順で行ってください.
- 1. もしconfigureファイルが見つからない、もしくは
- configure.inより古いようなら、autoconfを実行して
- 新しくconfigureを生成する
+1. もし +configure+ ファイルが見つからない、もしくは
+ +configure.in+ より古いようなら、 +autoconf+ を実行して
+ 新しく +configure+ を生成する
- 2. configureを実行してMakefileなどを生成する
+2. +configure+ を実行して +Makefile+ などを生成する
環境によってはデフォルトのCコンパイラ用オプションが付き
- ます.configureオプションで optflags=.. warnflags=.. 等
+ ます. +configure+ オプションで <tt>optflags=..</tt> <tt>warnflags=..</tt>
で上書きできます.
- 3. (必要ならば)defines.hを編集する
+3. (必要ならば)+defines.h+ を編集する
多分,必要無いと思います.
- 4. (必要ならば)ext/Setupに静的にリンクする拡張モジュールを
+4. (必要ならば)+ext/Setup+ に静的にリンクする拡張モジュールを
指定する
- ext/Setupに記述したモジュールは静的にリンクされます
+ +ext/Setup+ に記述したモジュールは静的にリンクされます
ダイナミックローディングをサポートしていないアーキテク
- チャではSetupの1行目の「option nodynamic」という行のコ
+ チャでは +Setup+ の1行目の「<tt>option nodynamic</tt>」という行のコ
メントを外す必要があります.また,このアーキテクチャで
拡張モジュールを利用するためには,あらかじめ静的にリン
クしておく必要があります.
- 5. makeを実行してコンパイルする
+5. +make+ を実行してコンパイルする
- 6. make testでテストを行う
+6. <tt>make check</tt>でテストを行う
- 「test succeeded」と表示されれば成功です.ただしテスト
+ 「<tt>check succeeded</tt>」と表示されれば成功です.ただしテスト
に成功しても完璧だと保証されている訳ではありません.
- 7. make install
+7. <tt>make install</tt>
以下のディレクトリを作って,そこにファイルをインストー
ルします.
- * ${DESTDIR}${prefix}/bin
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib
- * ${DESTDIR}${prefix}/lib/ruby
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
- * ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
- * ${DESTDIR}${prefix}/share/man/man1
- * ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system
-
- RubyのAPIバージョンが`x.y.z'であれば,((|${MAJOR}|))
- `x'で,((|${MINOR}|))は`y',((|${TEENY}|))は`z'です.
-
- 注意: APIバージョンのteenyは,Rubyプログラムのバージョ
+ * <tt>${DESTDIR}${prefix}/bin</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}</tt>
+ * <tt>${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}</tt>
+ * <tt>${DESTDIR}${prefix}/share/man/man1</tt>
+ * <tt>${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system</tt>
+
+ RubyのAPIバージョンが'_x.y.z_'であれば,<tt>${MAJOR}</tt>
+ '_x_'で,<tt>${MINOR}</tt>は'_y_',<tt>${TEENY}</tt>は'_z_'です.
+
+ <b>注意</b>: APIバージョンの +teeny+ は,Rubyプログラムのバージョ
ンとは異なることがあります.
- rootで作業する必要があるかもしれません
+ +root+ で作業する必要があるかもしれません
もし,コンパイル時にエラーが発生した場合にはエラーのログとマ
シン,OSの種類を含むできるだけ詳しいレポートを作者に送ってく
ださると他の方のためにもなります.
-* 移植
+== 移植
-UNIXであればconfigureがほとんどの差異を吸収してくれるはずで
+UNIXであれば +configure+ がほとんどの差異を吸収してくれるはずで
すが,思わぬ見落としがあった場合(あるに違いない),作者にその
ことをレポートすれば,解決できるかも知れません.
アーキテクチャにもっとも依存するのはGC部です.RubyのGCは対象
-のアーキテクチャがsetjmp()またはgetcontext()によって全てのレ
-ジスタをjmp_bufやucontext_tに格納することと,jmp_bufや
-ucontext_tとスタックが32bitアラインメントされていることを仮定
-しています.特に前者が成立しない場合の対応は非常に困難でしょ
-う.後者の解決は比較的簡単で,gc.cでスタックをマークしている
+のアーキテクチャが<tt>setjmp()</tt>または<tt>getcontext()</tt>によって全てのレ
+ジスタを +jmp_buf+ や +ucontext_t+ に格納することと, +jmp_buf+ や
++ucontext_t+ とスタックが32bitアラインメントされていることを仮定
+しています.特に前者が成立しない場合の対応は非常に困難でしょう.
+後者の解決は比較的簡単で, +gc.c+ でスタックをマークしている
部分にアラインメントのバイト数だけずらしてマークするコードを
-追加するだけで済みます.defined(__mc68000__)」で括られてい
+追加するだけで済みます.<tt>defined(\_\_mc68000\_\_)</tt>で括られてい
る部分を参考にしてください.
レジスタウィンドウを持つCPUでは,レジスタウィンドウをスタッ
@@ -170,16 +176,17 @@ ucontext_tとスタックが32bitアラインメントされていることを
れません.
-* 配布条件
+== 配布条件
-COPYING.jaファイルを参照してください
++COPYING.ja+ ファイルを参照してください
-* 著者
+== 著者
-コメント,バグレポートその他は matz@netlab.jp まで.
+コメント,バグレポートその他は mailto:matz@ruby-lang.jp まで.
-------------------------------------------------------
created at: Thu Aug 3 11:57:36 JST 1995
+--
Local variables:
-mode: indented-text
+mode: rdoc
end:
View
45 addr2line.c
@@ -68,6 +68,9 @@
# define ElfW(x) Elf32##_##x
# endif
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
typedef struct {
const char *dirname;
@@ -84,7 +87,8 @@ typedef struct {
static char binary_filename[PATH_MAX];
static unsigned long
-uleb128(char **p) {
+uleb128(char **p)
+{
unsigned long r = 0;
int s = 0;
for (;;) {
@@ -100,7 +104,8 @@ uleb128(char **p) {
}
static long
-sleb128(char **p) {
+sleb128(char **p)
+{
long r = 0;
int s = 0;
for (;;) {
@@ -215,19 +220,19 @@ parse_debug_line_cu(int num_traces, void **traces,
int default_is_stmt, line_base;
unsigned int header_length, minimum_instruction_length, line_range,
opcode_base;
- unsigned char *standard_opcode_lengths;
+ /* unsigned char *standard_opcode_lengths; */
/* The registers. */
unsigned long addr = 0;
unsigned int file = 1;
unsigned int line = 1;
- unsigned int column = 0;
+ /* unsigned int column = 0; */
int is_stmt;
- int basic_block = 0;
- int end_sequence = 0;
- int prologue_end = 0;
- int epilogue_begin = 0;
- unsigned int isa = 0;
+ /* int basic_block = 0; */
+ /* int end_sequence = 0; */
+ /* int prologue_end = 0; */
+ /* int epilogue_begin = 0; */
+ /* unsigned int isa = 0; */
p = *debug_line;
@@ -263,7 +268,7 @@ parse_debug_line_cu(int num_traces, void **traces,
opcode_base = *(unsigned char *)p;
p++;
- standard_opcode_lengths = (unsigned char *)p - 1;
+ /* standard_opcode_lengths = (unsigned char *)p - 1; */
p += opcode_base - 1;
include_directories = p;
@@ -283,7 +288,7 @@ parse_debug_line_cu(int num_traces, void **traces,
do { \
fill_line(num_traces, traces, addr, file, line, \
include_directories, filenames, lines); \
- basic_block = prologue_end = epilogue_begin = 0; \
+ /*basic_block = prologue_end = epilogue_begin = 0;*/ \
} while (0)
while (p < cu_end) {
@@ -306,13 +311,13 @@ parse_debug_line_cu(int num_traces, void **traces,
file = (unsigned int)uleb128(&p);
break;
case DW_LNS_set_column:
- column = (unsigned int)uleb128(&p);
+ /*column = (unsigned int)*/(void)uleb128(&p);
break;
case DW_LNS_negate_stmt:
is_stmt = !is_stmt;
break;
case DW_LNS_set_basic_block:
- basic_block = 1;
+ /*basic_block = 1; */
break;
case DW_LNS_const_add_pc:
a = ((255 - opcode_base) / line_range) *
@@ -324,28 +329,28 @@ parse_debug_line_cu(int num_traces, void **traces,
addr += a;
break;
case DW_LNS_set_prologue_end:
- prologue_end = 1;
+ /* prologue_end = 1; */
break;
case DW_LNS_set_epilogue_begin:
- epilogue_begin = 1;
+ /* epilogue_begin = 1; */
break;
case DW_LNS_set_isa:
- isa = (unsigned int)uleb128(&p);
+ /* isa = (unsigned int)*/(void)uleb128(&p);
break;
case 0:
a = *(unsigned char *)p++;
op = *p++;
switch (op) {
case DW_LNE_end_sequence:
- end_sequence = 1;
+ /* end_sequence = 1; */
FILL_LINE();
addr = 0;
file = 1;
line = 1;
- column = 0;
+ /* column = 0; */
is_stmt = default_is_stmt;
- end_sequence = 0;
- isa = 0;
+ /* end_sequence = 0; */
+ /* isa = 0; */
break;
case DW_LNE_set_address:
addr = *(unsigned long *)p;
View
43 array.c
@@ -755,6 +755,19 @@ rb_ary_push_1(VALUE ary, VALUE item)
return ary;
}
+VALUE
+rb_ary_cat(VALUE ary, const VALUE *ptr, long len)
+{
+ long oldlen;
+
+ rb_ary_modify(ary);
+ oldlen = RARRAY_LEN(ary);
+ ary_resize_capa(ary, oldlen + len);
+ MEMCPY(RARRAY_PTR(ary) + oldlen, ptr, VALUE, len);
+ ARY_SET_LEN(ary, oldlen + len);
+ return ary;
+}
+
/*
* call-seq:
* ary.push(obj, ... ) -> ary
@@ -771,11 +784,7 @@ rb_ary_push_1(VALUE ary, VALUE item)
static VALUE
rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
{
- rb_ary_modify(ary);
- while (argc--) {
- rb_ary_push_1(ary, *argv++);
- }
- return ary;
+ return rb_ary_cat(ary, argv, argc);
}
VALUE
@@ -1434,9 +1443,7 @@ rb_ary_aset(int argc, VALUE *argv, VALUE ary)
rb_ary_splice(ary, beg, len, argv[2]);
return argv[2];
}
- if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
- }
+ rb_check_arity(argc, 2, 2);
rb_ary_modify_check(ary);
if (FIXNUM_P(argv[0])) {
offset = FIX2LONG(argv[0]);
@@ -1471,9 +1478,7 @@ rb_ary_insert(int argc, VALUE *argv, VALUE ary)
{
long pos;
- if (argc < 1) {
- rb_raise(rb_eArgError, "wrong number of arguments (at least 1)");
- }
+ rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
rb_ary_modify_check(ary);
if (argc == 1) return ary;
pos = NUM2LONG(argv[0]);
@@ -2376,7 +2381,7 @@ rb_ary_select(VALUE ary)
/*
* call-seq:
- * ary.select! {|item| block } -> new_ary or nil
+ * ary.select! {|item| block } -> ary or nil
* ary.select! -> an_enumerator
*
* Invokes the block passing in successive elements from
@@ -2643,6 +2648,8 @@ ary_reject_bang(VALUE ary)
* Equivalent to Array#delete_if, deleting elements from
* +self+ for which the block evaluates to true, but returns
* <code>nil</code> if no changes were made.
+ * The array is changed instantly every time the block is called and
+ * not after the iteration is over.
* See also Enumerable#reject and Array#delete_if.
*
* If no block is given, an enumerator is returned instead.
@@ -2687,6 +2694,8 @@ rb_ary_reject(VALUE ary)
*
* Deletes every element of +self+ for which +block+ evaluates
* to true.
+ * The array is changed instantly every time the block is called and
+ * not after the iteration is over.
* See also Array#reject!
*
* If no block is given, an enumerator is returned instead.
@@ -3889,9 +3898,7 @@ rb_ary_shuffle_bang(int argc, VALUE *argv, VALUE ary)
if (OPTHASH_GIVEN_P(opts)) {
randgen = rb_hash_lookup2(opts, sym_random, randgen);
}
- if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
- }
+ rb_check_arity(argc, 0, 0);
rb_ary_modify(ary);
i = RARRAY_LEN(ary);
ptr = RARRAY_PTR(ary);
@@ -3949,6 +3956,10 @@ rb_ary_shuffle(int argc, VALUE *argv, VALUE ary)
* <code>nil</code> and the second form returns an empty array.
*
* If +rng+ is given, it will be used as the random number generator.
+ *
+ * a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
+ * a.sample #=> 7
+ * a.sample(4) #=> [6, 4, 2, 5]
*/
@@ -4467,7 +4478,7 @@ rb_ary_repeated_combination(VALUE ary, VALUE num)
* ary.product(other_ary, ...) -> new_ary
* ary.product(other_ary, ...) { |p| block } -> ary
*
- * Returns an array of all combinations of elements from all arrays,
+ * Returns an array of all combinations of elements from all arrays.
* The length of the returned array is the product of the length
* of +self+ and the argument arrays.
* If given a block, #product will yield all combinations
View
2  atomic.h
@@ -42,7 +42,7 @@ typedef unsigned int rb_atomic_t; /* Anything OK */
# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
# define ATOMIC_EXCHANGE(var, val) __sync_lock_test_and_set(&(var), (val))
-#elif defined(__SUNPRO_C)
+#elif defined(__sun)
#include <atomic.h>
typedef unsigned int rb_atomic_t;
View
2  benchmark/bm_app_raise.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<300000
i+=1
begin
View
2  benchmark/bm_app_strconcat.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<2_000_000
"#{1+1} #{1+1} #{1+1}"
i+=1
View
6 benchmark/bm_io_select2.rb
@@ -2,7 +2,11 @@
ios = []
nr = 1000000
-max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
((max / 2) - 10).times do
View
6 benchmark/bm_io_select3.rb
@@ -2,7 +2,11 @@
ios = []
nr = 100
-max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+if defined?(Process::RLIMIT_NOFILE)
+ max = Process.getrlimit(Process::RLIMIT_NOFILE)[0]
+else
+ max = 64
+end
puts "max fd: #{max} (results not apparent with <= 1024 max fd)"
(max - 10).times do
View
2  benchmark/bm_loop_whileloop.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<30_000_000 # benchmark loop 1
i+=1
end
View
2  benchmark/bm_loop_whileloop2.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i< 6_000_000 # benchmark loop 2
i+=1
end
View
2  benchmark/bm_so_concatenate.rb
@@ -5,7 +5,7 @@
# based on code from Aristarkh A Zagorodnikov and Dat Nguyen
STUFF = "hello\n"
-i=0
+i = 0
while i<10
i+=1
hello = ''
View
2  benchmark/bm_so_random.rb
@@ -12,7 +12,7 @@ def gen_random(max)
N = 3_000_000
-i=0
+i = 0
while i<N
i+=1
gen_random(100.0)
View
2  benchmark/bm_vm1_block.rb
@@ -2,7 +2,7 @@ def m
yield
end
-i=0
+i = 0
while i<30_000_000 # while loop 1
i+=1
m{
View
2  benchmark/bm_vm1_ensure.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<30_000_000 # benchmark loop 1
i+=1
begin
View
2  benchmark/bm_vm1_length.rb
@@ -1,6 +1,6 @@
a = 'abc'
b = [1, 2, 3]
-i=0
+i = 0
while i<30_000_000 # while loop 1
i+=1
a.length
View
18 benchmark/bm_vm1_lvar_init.rb
@@ -0,0 +1,18 @@
+def m v
+ unless v
+ # unreachable code
+ v1 = v2 = v3 = v4 = v5 = v6 = v7 = v8 = v9 = v10 =
+ v11 = v12 = v13 = v14 = v15 = v16 = v17 = v18 = v19 = v20 =
+ v21 = v22 = v23 = v24 = v25 = v26 = v27 = v28 = v29 = v30 =
+ v31 = v32 = v33 = v34 = v35 = v36 = v37 = v38 = v39 = v40 =
+ v41 = v42 = v43 = v44 = v45 = v46 = v47 = v48 = v49 = v50 = 1
+ end
+end
+
+i = 0
+
+while i<30_000_000 # while loop 1
+ i+=1
+ m i
+end
+
View
5 benchmark/bm_vm1_lvar_set.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<30_000_000 # while loop 1
+ i+= 1
+ a = b = c = d = e = f = g = h = j = k = l = m = n = o = p = q = r = 1
+end
View
2  benchmark/bm_vm1_rescue.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<30_000_000 # while loop 1
i+=1
begin
View
2  benchmark/bm_vm1_simplereturn.rb
@@ -1,7 +1,7 @@
def m
return 1
end
-i=0
+i = 0
while i<30_000_000 # while loop 1
i+=1
m
View
2  benchmark/bm_vm1_swap.rb
@@ -1,6 +1,6 @@
a = 1
b = 2
-i=0
+i = 0
while i<30_000_000 # while loop 1
i+=1
a, b = b, a
View
2  benchmark/bm_vm2_array.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
i+=1
a = [1,2,3,4,5,6,7,8,9,10]
View
106 benchmark/bm_vm2_bigarray.rb
@@ -0,0 +1,106 @@
+i = 0
+while i<6_000_000 # benchmark loop 2
+ i+=1
+ a = [
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ 1,2,3,4,5,6,7,8,9,10,
+ ]
+end
View
5 benchmark/bm_vm2_bighash.rb
@@ -0,0 +1,5 @@
+i = 0
+while i<60_000 # benchmark loop 2
+ i+=1
+ a = {0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20, 21=>21, 22=>22, 23=>23, 24=>24, 25=>25, 26=>26, 27=>27, 28=>28, 29=>29, 30=>30, 31=>31, 32=>32, 33=>33, 34=>34, 35=>35, 36=>36, 37=>37, 38=>38, 39=>39, 40=>40, 41=>41, 42=>42, 43=>43, 44=>44, 45=>45, 46=>46, 47=>47, 48=>48, 49=>49, 50=>50, 51=>51, 52=>52, 53=>53, 54=>54, 55=>55, 56=>56, 57=>57, 58=>58, 59=>59, 60=>60, 61=>61, 62=>62, 63=>63, 64=>64, 65=>65, 66=>66, 67=>67, 68=>68, 69=>69, 70=>70, 71=>71, 72=>72, 73=>73, 74=>74, 75=>75, 76=>76, 77=>77, 78=>78, 79=>79, 80=>80, 81=>81, 82=>82, 83=>83, 84=>84, 85=>85, 86=>86, 87=>87, 88=>88, 89=>89, 90=>90, 91=>91, 92=>92, 93=>93, 94=>94, 95=>95, 96=>96, 97=>97, 98=>98, 99=>99, 100=>100, 101=>101, 102=>102, 103=>103, 104=>104, 105=>105, 106=>106, 107=>107, 108=>108, 109=>109, 110=>110, 111=>111, 112=>112, 113=>113, 114=>114, 115=>115, 116=>116, 117=>117, 118=>118, 119=>119, 120=>120, 121=>121, 122=>122, 123=>123, 124=>124, 125=>125, 126=>126, 127=>127, 128=>128, 129=>129, 130=>130, 131=>131, 132=>132, 133=>133, 134=>134, 135=>135, 136=>136, 137=>137, 138=>138, 139=>139, 140=>140, 141=>141, 142=>142, 143=>143, 144=>144, 145=>145, 146=>146, 147=>147, 148=>148, 149=>149, 150=>150, 151=>151, 152=>152, 153=>153, 154=>154, 155=>155, 156=>156, 157=>157, 158=>158, 159=>159, 160=>160, 161=>161, 162=>162, 163=>163, 164=>164, 165=>165, 166=>166, 167=>167, 168=>168, 169=>169, 170=>170, 171=>171, 172=>172, 173=>173, 174=>174, 175=>175, 176=>176, 177=>177, 178=>178, 179=>179, 180=>180, 181=>181, 182=>182, 183=>183, 184=>184, 185=>185, 186=>186, 187=>187, 188=>188, 189=>189, 190=>190, 191=>191, 192=>192, 193=>193, 194=>194, 195=>195, 196=>196, 197=>197, 198=>198, 199=>199, 200=>200, 201=>201, 202=>202, 203=>203, 204=>204, 205=>205, 206=>206, 207=>207, 208=>208, 209=>209, 210=>210, 211=>211, 212=>212, 213=>213, 214=>214, 215=>215, 216=>216, 217=>217, 218=>218, 219=>219, 220=>220, 221=>221, 222=>222, 223=>223, 224=>224, 225=>225, 226=>226, 227=>227, 228=>228, 229=>229, 230=>230, 231=>231, 232=>232, 233=>233, 234=>234, 235=>235, 236=>236, 237=>237, 238=>238, 239=>239, 240=>240, 241=>241, 242=>242, 243=>243, 244=>244, 245=>245, 246=>246, 247=>247, 248=>248, 249=>249, 250=>250, 251=>251, 252=>252, 253=>253, 254=>254, 255=>255, 256=>256, 257=>257, 258=>258, 259=>259, 260=>260, 261=>261, 262=>262, 263=>263, 264=>264, 265=>265, 266=>266, 267=>267, 268=>268, 269=>269, 270=>270, 271=>271, 272=>272, 273=>273, 274=>274, 275=>275, 276=>276, 277=>277, 278=>278, 279=>279, 280=>280, 281=>281, 282=>282, 283=>283, 284=>284, 285=>285, 286=>286, 287=>287, 288=>288, 289=>289, 290=>290, 291=>291, 292=>292, 293=>293, 294=>294, 295=>295, 296=>296, 297=>297, 298=>298, 299=>299, 300=>300, 301=>301, 302=>302, 303=>303, 304=>304, 305=>305, 306=>306, 307=>307, 308=>308, 309=>309, 310=>310, 311=>311, 312=>312, 313=>313, 314=>314, 315=>315, 316=>316, 317=>317, 318=>318, 319=>319, 320=>320, 321=>321, 322=>322, 323=>323, 324=>324, 325=>325, 326=>326, 327=>327, 328=>328, 329=>329, 330=>330, 331=>331, 332=>332, 333=>333, 334=>334, 335=>335, 336=>336, 337=>337, 338=>338, 339=>339, 340=>340, 341=>341, 342=>342, 343=>343, 344=>344, 345=>345, 346=>346, 347=>347, 348=>348, 349=>349, 350=>350, 351=>351, 352=>352, 353=>353, 354=>354, 355=>355, 356=>356, 357=>357, 358=>358, 359=>359, 360=>360, 361=>361, 362=>362, 363=>363, 364=>364, 365=>365, 366=>366, 367=>367, 368=>368, 369=>369, 370=>370, 371=>371, 372=>372, 373=>373, 374=>374, 375=>375, 376=>376, 377=>377, 378=>378, 379=>379, 380=>380, 381=>381, 382=>382, 383=>383, 384=>384, 385=>385, 386=>386, 387=>387, 388=>388, 389=>389, 390=>390, 391=>391, 392=>392, 393=>393, 394=>394, 395=>395, 396=>396, 397=>397, 398=>398, 399=>399, 400=>400, 401=>401, 402=>402, 403=>403, 404=>404, 405=>405, 406=>406, 407=>407, 408=>408, 409=>409, 410=>410, 411=>411, 412=>412, 413=>413, 414=>414, 415=>415, 416=>416, 417=>417, 418=>418, 419=>419, 420=>420, 421=>421, 422=>422, 423=>423, 424=>424, 425=>425, 426=>426, 427=>427, 428=>428, 429=>429, 430=>430, 431=>431, 432=>432, 433=>433, 434=>434, 435=>435, 436=>436, 437=>437, 438=>438, 439=>439, 440=>440, 441=>441, 442=>442, 443=>443, 444=>444, 445=>445, 446=>446, 447=>447, 448=>448, 449=>449, 450=>450, 451=>451, 452=>452, 453=>453, 454=>454, 455=>455, 456=>456, 457=>457, 458=>458, 459=>459, 460=>460, 461=>461, 462=>462, 463=>463, 464=>464, 465=>465, 466=>466, 467=>467, 468=>468, 469=>469, 470=>470, 471=>471, 472=>472, 473=>473, 474=>474, 475=>475, 476=>476, 477=>477, 478=>478, 479=>479, 480=>480, 481=>481, 482=>482, 483=>483, 484=>484, 485=>485, 486=>486, 487=>487, 488=>488, 489=>489, 490=>490, 491=>491, 492=>492, 493=>493, 494=>494, 495=>495, 496=>496, 497=>497, 498=>498, 499=>499, 500=>500,}
+end
View
2  benchmark/bm_vm2_case.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<6_000_000 # while loop 2
case :foo
when :bar
View
2  benchmark/bm_vm2_defined_method.rb
@@ -2,7 +2,7 @@ class Object
define_method(:m){}
end
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
View
2  benchmark/bm_vm2_eval.rb
@@ -1,4 +1,4 @@
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
i+=1
eval("1")
View
2  benchmark/bm_vm2_method.rb
@@ -2,7 +2,7 @@ def m
nil
end
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
i+=1
m; m; m; m; m; m; m; m;
View
2  benchmark/bm_vm2_mutex.rb
@@ -2,7 +2,7 @@
m = Mutex.new
-i=0
+i = 0
while i<6_000_000 # benchmark loop 2
i+=1