[#33948] Schedule for the 1.8.7 release — "Akinori MUSHA" <knu@...>
Hi, developers,
[#33955] --encoding affects script encoding — sheepman <sheepman@...>
こんばんは sheepman です。
なかだです。
[#33962] Ruby1.9.0でのインタプリタ組み込みについての質問 — Masayuki Yamaguchi <Yamaguchi.Masayuki@...>
山口と申します。
[#33966] Re: [ruby-cvs:22881] Ruby:r15644 (trunk): * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test — Tanaka Akira <akr@...>
In article <[email protected]>,
まつもと ゆきひろです
[#33974] Test::Unit::Collector::Dirがtest_*.rb以外集めてくれない — "Ken Date" <itacchi@...>
こんにちは、伊達です。
[#33983] Re: [ruby-cvs:22913] Re: Ruby:r15674 (trunk): * gc.c (add_heap): sort heaps array in ascending order to use — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
In article <[email protected]>,
[#34011] Should --verbose be equal to -v ? — Yugui <yugui@...>
Yuguiです。
まつもと ゆきひろです
西山和広です。
Yuguiです。
[#34020] MurmurHash problem — Nobuyoshi Nakada <nobu@...>
なかだです。
[#34030] uint32_t — KIMURA Koichi <kimura.koichi@...>
木村です。
[#34037] Ruby performance gains on SPARC — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#34067] Array#take,take_while,drop,drop_whlie — "Yusuke ENDOH" <mame@...>
遠藤と申します。
[#34068] lgamma_r requires _REENTRANT on Solaris — "Yusuke ENDOH" <mame@...>
遠藤と申します。
[#34077] 異なるエンコーディングだと同じバイト列でも==にならない件 — rubikitch@...
るびきちです。
[#34086] extend spawn to change attributes of child process. — Tanaka Akira <akr@...>
spaen, system, exec, IO.popen で、起動する子プロセスの属性を
[#34093] 拡張ライブラリ初期化中でのmodule_eval — Kouhei Sutou <kou@...>
須藤です。
[#34095] (再送) Cygwin で Resolv.getaddress が失敗する — Kouhei Yanagita <yanagi@...>
こんにちは。柳田です。
こんばんは、植田と申します。
柳田です。
[#34105] rational.rb, complex.rb and mathn.rb — Tadayoshi Funaba <tadf@...>
rational と complex が組み込みになったことで、lib/mathn.rb の意義は薄
現時点で rational.rb と complex.rb を残しているのは、それが無難だから
で、かなり選択肢を絞った叩き台です。
けいじゅ@いしつかです.
原です。
> 私も Complex の組み込みは Rational とは比較にならないくらい、仕様が決め
まつもと ゆきひろです
> Mathモジュールは伝統的にlibmのラッパーであったので、それを逸
原です。
> (1) (-8)**Rational(1,2) は複素数1.0+1.7320508*i
[#34109] LP64: date.rb:321:in `convert': integer 86400000000000 too big to convert to `int' (RangeError) — Tanaka Akira <akr@...>
LP64 なマシンで test-all が動かなくなっています。
[#34144] [質問2点] C からの定数参照 & thread switching コストの低減 — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
[#34158] Complex組み込み — Masahiro TANAKA <masa16.tanaka@...>
Complexが組み込みになるそうですが、これはcomplex.rbを踏襲して、
原です。
> 今までの Complex は、complex.rb にほぼ残して、たとえば Rational 成分
原です。
> そうです。Complex が難しい、という話を書いておくと、
まつもと ゆきひろです
> |僕としては、/ 演算子の振舞いについて前向きに検討してほしいです。
まつもと ゆきひろです
> ふむ。では、/ のふるまいを
まつもと ゆきひろです
> |僕は、quo がいいと思います。
まつもと ゆきひろです
> となるようですが、別の実装として、
田中です。
> 最初に言っておきますが、気を悪くされたのならすみません。
村田です.
[#34159] ruby-trunk Marshal.dump bug — nagachika <rucila@...>
nagachika と申します。
[#34163] Array#shift/unshift の高速化 — wanabe <s.wanabe@...>
ワナベと申します。
[#34189] Re: [ruby-cvs:23106] Re: Ruby:r15866 (trunk): * numeric.c (num_quo): should convert its operand to Rational. — Tadayoshi Funaba <tadf@...>
間違って送ったので、再送。
> > > Log:
[ruby-dev:34027] Re: MurmurHash problem
なかだです。
At Wed, 12 Mar 2008 19:50:18 +0900,
NARUSE, Yui wrote in [ruby-dev:34026]:
> というわけで、int32_t, uint32_t, intptr_t, uintptr_t を定義しつつ、
> hash() をアライメント考慮させるパッチです。
inttypes.hをチェックしてないような気がします。
あとBig endianになるとやや遅くなりそうなので、一応作っておいたの
も出してみます。
Index: configure.in
===================================================================
--- configure.in (revision 15758)
+++ configure.in (working copy)
@@ -583,5 +583,5 @@ AC_CHECK_HEADERS(stdlib.h string.h unist
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h pthread.h \
- ucontext.h intrinsics.h langinfo.h locale.h)
+ ucontext.h intrinsics.h langinfo.h locale.h stdint.h)
dnl Check additional types.
@@ -621,4 +621,16 @@ AC_CHECK_TYPES(struct timespec)
AC_CHECK_TYPE(fd_mask, [AC_DEFINE(HAVE_RB_FD_INIT, 1)])
+test ${rb_cv_type_uint32_t+set} && ac_cv_type_uint32_t=yes
+AC_CHECK_TYPE(uint32_t)
+if test ${ac_cv_type_uint32_t} != yes; then
+ AC_CACHE_CHECK([unsigned 32bit int],
+ rb_cv_type_uint32_t,
+ [for type in short int long; do
+ AC_COMPILE_IFELSE(AC_LANG_BOOL_COMPILE_TRY([], [sizeof($type) == 4]),
+ [rb_cv_type_uint32_t=$type; break], [])
+ done])
+ AC_DEFINE(uint32_t, $rb_cv_type_uint32_t)
+fi
+
AC_CACHE_CHECK(for stack end address, rb_cv_stack_end_address,
[rb_cv_stack_end_address=no
Index: string.c
===================================================================
--- string.c (revision 15758)
+++ string.c (working copy)
@@ -26,4 +26,8 @@
#endif
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
VALUE rb_cString;
VALUE rb_cSymbol;
@@ -1686,4 +1690,11 @@ rb_str_concat(VALUE str1, VALUE str2)
}
+#if defined __i386__ || defined _M_IX86 || defined __ia64
+#define UNALIGNED_WORD_ACCESS 1
+#endif
+#ifndef UNALIGNED_WORD_ACCESS
+#define UNALIGNED_WORD_ACCESS 0
+#endif
+
/* MurmurHash described in http://murmurhash.googlepages.com/ */
unsigned int
@@ -1695,14 +1706,93 @@ hash(const unsigned char * data, int len
h += 0xdeadbeef;
- while(len >= 4) {
- h += *(unsigned int *)data;
- h *= m;
- h ^= h >> r;
+ if (len >= 4) {
+#if !UNALIGNED_WORD_ACCESS
+ int align = (VALUE)data & 3;
+ if (align) {
+ uint32_t t = 0, d = 0;
+ int sl, sr, pack;
+
+ switch (align) {
+#ifdef WORDS_BIGENDIAN
+ case 1: t |= data[2];
+ case 2: t |= data[1] << 8;
+ case 3: t |= data[0] << 16;
+#else
+ case 1: t |= data[2] << 16;
+ case 2: t |= data[1] << 8;
+ case 3: t |= data[0];
+#endif
+ }
+
+ t <<= (8 * align);
+
+ data += 4-align;
+ len -= 4-align;
+
+ sl = 8 * (4-align);
+ sr = 8 * align;
+
+ while (len >= 4) {
+ d = *(uint32_t *)data;
+#ifdef WORDS_BIGENDIAN
+ t = (t << sr) | (d >> sl);
+#else
+ t = (t >> sr) | (d << sl);
+#endif
+ h += t;
+ h *= m;
+ h ^= h >> r;
+ t = d;
+
+ data += 4;
+ len -= 4;
+ }
+
+ pack = len < align ? len : align;
+ d = 0;
+ switch (pack) {
+#ifdef WORDS_BIGENDIAN
+ case 3: d |= data[2];
+ case 2: d |= data[1] << 8;
+ case 1: d |= data[0] << 16;
+ case 0:
+ h += (t << sr) | (d >> sl);
+#else
+ case 3: d |= data[2] << 16;
+ case 2: d |= data[1] << 8;
+ case 1: d |= data[0];
+ case 0:
+ h += (t >> sr) | (d << sl);
+#endif
+ h *= m;
+ h ^= h >> r;
+ }
- data += 4;
- len -= 4;
+ data += pack;
+ len -= pack;
+ }
+ else
+#endif
+ {
+ do {
+ h += *(uint32_t *)data;
+ h *= m;
+ h ^= h >> r;
+
+ data += 4;
+ len -= 4;
+ } while (len >= 4);
+ }
}
switch(len) {
+#ifdef WORDS_BIGENDIAN
+ case 3:
+ h += data[2];
+ case 2:
+ h += data[1] << 8;
+ case 1:
+ h += data[0] << 16;
+#else
case 3:
h += data[2] << 16;
@@ -1711,4 +1801,5 @@ hash(const unsigned char * data, int len
case 1:
h += data[0];
+#endif
h *= m;
h ^= h >> r;
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦