[#38563] [Bug #1556] irb does not save history from 1.8.7-p83 and later — Nobuhiro IMAI <redmine@...>
Bug #1556: irb does not save history from 1.8.7-p83 and later
けいじゅ@いしつかです.
まつもと ゆきひろです
いまいです。
けいじゅ@いしつかです.
[#38571] [Bug #1582] IO.new Raises Other Errors between 1.8 and 1.9 — "ujihisa ." <redmine@...>
Bug #1582: IO.new Raises Other Errors between 1.8 and 1.9
チケット #1582 が更新されました。 (by Motohiro KOSAKI)
なかだです。
2010年2月27日9:43 Nobuyoshi Nakada <nobu@ruby-lang.org>:
[#38602] [Feature: trunk] rb_objspace_each_objects — SASADA Koichi <ko1@...>
ささだです.
まつもと ゆきひろです
ささだです.
ささだです.
まつもと ゆきひろです
[#38607] [Feature: trunk] GC.stat — SASADA Koichi <ko1@...>
ささだです.
In article <4A349F64.5000702@atdot.net>,
ささだです.
In article <4A3612EF.1080008@atdot.net>,
ささだです。
まつもと ゆきひろです
ささだです。
2010年10月15日16:32 SASADA Koichi <ko1@atdot.net>:
[#38608] Fixnum#fdiv — Tadayoshi Funaba <tadf@...>
Bignum#fdiv には大きな数である場合の配慮があるようですが、Fixnum ではな
fdiv では2つの異る解釈が混在しているように見えます。
まつもと ゆきひろです
> えーと、設計者は「fdivは結果がfloatになるdiv」くらいしか考え
まつもと ゆきひろです
> ふむ。「中途半端」というのはfixnumとbignumで食い違うと言う意
> > ふむ。「中途半端」というのはfixnumとbignumで食い違うと言う意
まつもと ゆきひろです
> 私が気にしているのは「挙動の理解しやすさ」ですね。
まつもと ゆきひろです
> 繰り返しになりますが、「より正確な除算」とかだと独立した実装
まつもと ゆきひろです
この件を修正しようとしていますが、
[#38609] [Feature: trunk] *_memsize() — SASADA Koichi <ko1@...>
ささだです.
[#38613] [BUG: trunk] called on terminated object — SASADA Koichi <ko1@...>
ささだです.
[#38695] [feature:trunk] let irb use pretty_inspect if possible — Yusuke ENDOH <mame@...>
遠藤です。
けいじゅ@いしつかです.
遠藤です。
けいじゅ@いしつかです.
[#38698] [Bug #1674] set_trace_func with 1line block — _ wanabe <redmine@...>
Bug #1674: set_trace_func with 1line block
[#38701] [Bug #1676] only last "return" is traced by set_trace_func — _ wanabe <redmine@...>
Bug #1676: only last "return" is traced by set_trace_func
[ruby-dev:38607] [Feature: trunk] GC.stat
ささだです.
現在の GC 関連の状態を表示するためのメソッド GC.stat を追加するのはど
うでしょうか.
{:count=>1, # これまで GC が起こった回数
:elapsed_time=>0.004, # これまで GC にかかったユーザ時間
:heap_used=>20, # 利用中の heap の数
:heap_length=>22, # 確保した heap の数
:heap_live_slot=>4742, # 生きている slot の数 (*1)
:heap_free_slot=>5056, # 空いている slot の数 (*1)
:heap_waiting_finalize_slot=>23} # ファイナライザを待っている slot の数
*1: 一番最後の GC でカウント.
# Gauche では gc-stat というものがある,と shiro さんに聞いたもので.
gosh> (gc-stat)
((:total-heap-size 786432) (:free-bytes 163840) (:bytes-since-gc 532376)
(:total-bytes 532352))
Index: gc.c
===================================================================
--- gc.c (リビジョン 23689)
+++ gc.c (作業コピー)
@@ -323,6 +323,9 @@ typedef struct rb_objspace {
size_t length;
size_t used;
size_t longlife_used;
+ size_t total_live_slot;
+ size_t total_free_slot;
+ size_t total_waiting_finalize_slot;
RVALUE *freelist;
RVALUE *longlife_freelist;
RVALUE *range[2];
@@ -355,7 +358,8 @@ typedef struct rb_objspace {
double invoke_time;
} profile;
struct gc_list *global_list;
- unsigned int count;
+ size_t count;
+ double elapsed_time;
int gc_stress;
} rb_objspace_t;
@@ -933,7 +937,8 @@ assign_heap_slot(rb_objspace_t *objspace
if (lomem == 0 || lomem > p) lomem = p;
if (himem < pend) himem = pend;
if (lifetime == lifetime_longlife) objspace->heap.longlife_used++;
- heaps_used++;
+ objspace->heap.used++;
+ objspace->heap.total_free_slot += objs;
while (p < pend) {
p->as.free.flags = 0;
@@ -1832,7 +1837,7 @@ static void
gc_sweep(rb_objspace_t *objspace)
{
RVALUE *p, *pend, *final_list;
- size_t freed = 0;
+ size_t freed = 0, waiting_finalize = 0;
size_t i;
size_t live = 0, free_min = 0, do_heap_free = 0;
@@ -1868,6 +1873,7 @@ gc_sweep(rb_objspace_t *objspace)
p->as.free.next = final_list;
final_list = p;
final_num++;
+ waiting_finalize++;
}
else {
add_freelist(objspace, &freelist, p);
@@ -1877,6 +1883,7 @@ gc_sweep(rb_objspace_t *objspace)
else if (BUILTIN_TYPE(p) == T_ZOMBIE) {
/* objects to be finalized */
/* do nothing remain marked */
+ waiting_finalize++;
}
else {
RBASIC(p)->flags &= ~FL_MARK;
@@ -1923,6 +1930,10 @@ gc_sweep(rb_objspace_t *objspace)
free_unused_heaps(objspace);
GC_PROF_SET_HEAP_INFO;
}
+
+ objspace->heap.total_live_slot = live;
+ objspace->heap.total_free_slot = freed;
+ objspace->heap.total_waiting_finalize_slot = waiting_finalize;
}
static void
@@ -2207,6 +2218,8 @@ garbage_collect(rb_objspace_t *objspace)
{
struct gc_list *list;
rb_thread_t *th = GET_THREAD();
+ double invoke_time = getrusage_time();
+
INIT_GC_PROF_PARAMS;
if (GC_NOTIFY) printf("start garbage_collect()\n");
@@ -2286,6 +2299,8 @@ garbage_collect(rb_objspace_t *objspace)
GC_PROF_TIMER_STOP;
if (GC_NOTIFY) printf("end garbage_collect()\n");
+ objspace->elapsed_time += getrusage_time() - invoke_time;
+
return Qtrue;
}
@@ -2950,6 +2965,33 @@ gc_count(VALUE self)
return UINT2NUM((&rb_objspace)->count);
}
+/*
+ * call-seq:
+ * GC.stat -> Hash
+ *
+ * Return information about GC.
+ *
+ * It returns several information about GC:
+ * total count, elapesed time, heap size, and so on.
+ *
+ */
+static VALUE
+gc_stat(VALUE self)
+{
+ VALUE hash = rb_hash_new();
+ rb_objspace_t *objspace = &rb_objspace;
+
+ rb_hash_aset(hash, ID2SYM(rb_intern("count")),
SIZET2NUM(objspace->count));
+ rb_hash_aset(hash, ID2SYM(rb_intern("elapsed_time")),
DBL2NUM(objspace->elapsed_time));
+ rb_hash_aset(hash, ID2SYM(rb_intern("heap_used")),
SIZET2NUM(objspace->heap.used));
+ rb_hash_aset(hash, ID2SYM(rb_intern("heap_length")),
SIZET2NUM(objspace->heap.length));
+ rb_hash_aset(hash, ID2SYM(rb_intern("heap_live_slot")),
SIZET2NUM(objspace->heap.total_live_slot));
+ rb_hash_aset(hash, ID2SYM(rb_intern("heap_free_slot")),
SIZET2NUM(objspace->heap.total_free_slot));
+ rb_hash_aset(hash, ID2SYM(rb_intern("heap_waiting_finalize_slot")),
SIZET2NUM(objspace->heap.total_waiting_finalize_slot));
+
+ return hash;
+}
+
#if CALC_EXACT_MALLOC_SIZE
/*
* call-seq:
@@ -3122,6 +3164,7 @@ Init_GC(void)
rb_define_singleton_method(rb_mGC, "stress", gc_stress_get, 0);
rb_define_singleton_method(rb_mGC, "stress=", gc_stress_set, 1);
rb_define_singleton_method(rb_mGC, "count", gc_count, 0);
+ rb_define_singleton_method(rb_mGC, "stat", gc_stat, 0);
rb_define_method(rb_mGC, "garbage_collect", rb_gc_start, 0);
rb_mProfiler = rb_define_module_under(rb_mGC, "Profiler");
--
// SASADA Koichi at atdot dot net