[#3234] sample of TkFont class — NAGAI Hidetoshi <nagai@...>

永井@知能.九工大です.

52 messages 1998/07/08
[#3241] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/09

永井@知能.九工大です.

[#3290] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/15

永井@知能.九工大です.

[#3291] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3307] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3309] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3319] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3321] Re: sample of TkFont class — matz@... (Yukihiro Matsumoto) 1998/07/16

まつもと ゆきひろです

[#3324] Re: sample of TkFont class — NAGAI Hidetoshi <nagai@...> 1998/07/16

永井@知能.九工大です.

[#3367] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3369] Re: sample of TkFont class — ttate@... 1998/07/22

立石@JAISTです。

[#3370] Re: sample of TkFont class — Tadayoshi Funaba <tadf@...> 1998/07/22

ふなばです。

[#3371] Re: sample of TkFont class — ttate@... 1998/07/23

立石@JAISTです。

[#3292] exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

20 messages 1998/07/15
[#3293] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[#3294] Re: exprimental release 1.1b9_31 (hopefully final) — matz@... (Yukihiro Matsumoto) 1998/07/15

まつもと ゆきひろです

[#3295] Re: exprimental release 1.1b9_31 (hopefully final) — Takahiro Maebashi <maebashi@...> 1998/07/15

前橋です。

[ruby-dev:3284] Re: [Request] GC methods

From: ttate@...
Date: 1998-07-13 23:17:35 UTC
List: ruby-dev #3284
立石@JAISTです。

さっき流したパッチにはバグがありました。
追加パッチです。

1. malloc_memoriesが増えない
2. 一応rb_gc_malloc_limit値の初期値は0 ?

;; ついでに余計なメソッドもついてます、、、(^^;
;; ちょっとGCに関しての測定をしたかったので、、、


*** gc.c.orig2	Tue Jul 14 07:33:11 1998
--- gc.c	Tue Jul 14 07:58:06 1998
***************
*** 44,51 ****
  #endif
  
  static unsigned long malloc_memories = 0;
! static unsigned long rb_gc_malloc_limit = GC_MALLOC_LIMIT;
  static int rb_gc_show_flag = 0;
  
  void *
  xmalloc(size)
--- 44,52 ----
  #endif
  
  static unsigned long malloc_memories = 0;
! static unsigned long rb_gc_malloc_limit = 0;
  static int rb_gc_show_flag = 0;
+ static unsigned long rb_gc_abort_size = 0;
  
  void *
  xmalloc(size)
***************
*** 58,70 ****
      }
      if (size == 0) size = 1;
  
      if( rb_gc_malloc_limit > 0 ){
-       malloc_memories += size;
        if (malloc_memories > rb_gc_malloc_limit) {
  	gc_gc();
        }
      };
  
      mem = malloc(size);
      if (!mem) {
  	gc_gc();
--- 59,74 ----
      }
      if (size == 0) size = 1;
  
+     malloc_memories += size;
      if( rb_gc_malloc_limit > 0 ){
        if (malloc_memories > rb_gc_malloc_limit) {
  	gc_gc();
        }
      };
  
+     if ( (rb_gc_abort_size > 0) && (malloc_memories > rb_gc_abort_size) )
+       Fatal("allocation size is too big");
+ 
      mem = malloc(size);
      if (!mem) {
  	gc_gc();
***************
*** 194,199 ****
--- 198,229 ----
    return Qnil;
  }
  
+ VALUE
+ gc_s_set_abort(VALUE slef, VALUE size)
+ {
+   rb_gc_abort_size = num2ulong(size);
+   return Qnil;
+ }
+ 
+ VALUE
+ gc_s_unset_abort(VALUE self)
+ {
+   rb_gc_abort_size = 0;
+   return Qnil;
+ }
+ 
+ VALUE
+ gc_s_abort_size(VALUE self)
+ {
+   return uint2inum(rb_gc_abort_size);
+ }
+ 
+ VALUE
+ gc_s_memory_size(VALUE self)
+ {
+   return uint2inum(malloc_memories);
+ }
+ 
  VALUE mGC;
  
  static struct gc_list {
***************
*** 1109,1114 ****
--- 1139,1148 ----
      rb_define_singleton_method(mGC, "show?", gc_s_show_q, 0);
      rb_define_singleton_method(mGC, "show", gc_s_show, 0);
      rb_define_singleton_method(mGC, "unshow", gc_s_unshow, 0);
+     rb_define_singleton_method(mGC, "set_abort", gc_s_set_abort, 1);
+     rb_define_singleton_method(mGC, "unset_abort", gc_s_unset_abort, 0);
+     rb_define_singleton_method(mGC, "abort_size", gc_s_abort_size, 0);
+     rb_define_singleton_method(mGC, "memory_size", gc_s_memory_size, 0);
      rb_define_method(mGC, "garbage_collect", gc_method, 0);
  
      mObSpace = rb_define_module("ObjectSpace");

In This Thread